Merge "liblog: remove code checking for fd = 0"
am: 5d7969b58a
Change-Id: I240832dbc14fc8ef10f331d80fc84abd8fcfd820
This commit is contained in:
commit
036b7c2998
1 changed files with 1 additions and 7 deletions
|
@ -107,7 +107,7 @@ static int socket_local_client(const std::string& name, int type) {
|
|||
strlcpy(addr.sun_path, path.c_str(), sizeof(addr.sun_path));
|
||||
|
||||
int fd = socket(AF_LOCAL, type | SOCK_CLOEXEC, 0);
|
||||
if (fd == 0) {
|
||||
if (fd == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -337,12 +337,6 @@ static int logdOpen(struct android_log_logger_list* logger_list,
|
|||
}
|
||||
|
||||
sock = socket_local_client("logdr", SOCK_SEQPACKET);
|
||||
if (sock == 0) {
|
||||
/* Guarantee not file descriptor zero */
|
||||
int newsock = socket_local_client("logdr", SOCK_SEQPACKET);
|
||||
close(sock);
|
||||
sock = newsock;
|
||||
}
|
||||
if (sock <= 0) {
|
||||
if ((sock == -1) && errno) {
|
||||
return -errno;
|
||||
|
|
Loading…
Reference in a new issue