Add socket name in error log message
Change-Id: I229ce4c5bfa54df26ff00d68377dfc91cf11f5f0 CRs-Fixed: 2338533
This commit is contained in:
parent
21b9c4e47e
commit
f3b1394b15
1 changed files with 6 additions and 3 deletions
|
@ -203,7 +203,8 @@ bool LocIpc::sendData(int fd, const sockaddr_un &addr, const uint8_t data[], uin
|
|||
if (length <= LOC_MSG_BUF_LEN) {
|
||||
if (::sendto(fd, data, length, 0,
|
||||
(struct sockaddr*)&addr, sizeof(addr)) < 0) {
|
||||
LOC_LOGe("cannot send to socket. reason:%s", strerror(errno));
|
||||
LOC_LOGe("cannot send to socket:%s. reason:%s",
|
||||
addr.sun_path, strerror(errno));
|
||||
result = false;
|
||||
}
|
||||
} else {
|
||||
|
@ -211,7 +212,8 @@ bool LocIpc::sendData(int fd, const sockaddr_un &addr, const uint8_t data[], uin
|
|||
head.append(std::to_string(length));
|
||||
if (::sendto(fd, head.c_str(), head.length(), 0,
|
||||
(struct sockaddr*)&addr, sizeof(addr)) < 0) {
|
||||
LOC_LOGe("cannot send to socket. reason:%s", strerror(errno));
|
||||
LOC_LOGe("cannot send to socket:%s. reason:%s",
|
||||
addr.sun_path, strerror(errno));
|
||||
result = false;
|
||||
} else {
|
||||
size_t sentBytes = 0;
|
||||
|
@ -223,7 +225,8 @@ bool LocIpc::sendData(int fd, const sockaddr_un &addr, const uint8_t data[], uin
|
|||
ssize_t rv = ::sendto(fd, data + sentBytes, partLen, 0,
|
||||
(struct sockaddr*)&addr, sizeof(addr));
|
||||
if (rv < 0) {
|
||||
LOC_LOGe("cannot send to socket. reason:%s", strerror(errno));
|
||||
LOC_LOGe("cannot send to socket:%s. reason:%s",
|
||||
addr.sun_path, strerror(errno));
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue