Property: Log errno for socket connect

It's currently not clear that the error no indicating the
failure to invoke the library function. This change introduces
logs at the failing of socket connect, that could be clearly
get the true reason.

Test: Set system property with failed, and socket recv errno
      log will show

Change-Id: I36bf66988811f953e679d1c5a468de0bf1ab0a05
Signed-off-by: Jinguang Dong <dongjinguang@huawei.com>
This commit is contained in:
DuXiao 2018-05-21 14:43:56 +08:00 committed by Jinguang Dong
parent 74bf81443f
commit 4053359c7f
1 changed files with 5 additions and 0 deletions

View File

@ -371,6 +371,7 @@ class SocketConnection {
int result = TEMP_FAILURE_RETRY(recv(socket_, data, bytes_left, MSG_DONTWAIT));
if (result <= 0) {
PLOG(ERROR) << "sys_prop: recv error";
return false;
}
@ -378,6 +379,10 @@ class SocketConnection {
data += result;
}
if (bytes_left != 0) {
LOG(ERROR) << "sys_prop: recv data is not properly obtained.";
}
return bytes_left == 0;
}