Merge "liblog: use SOCK_NONBLOCK directly."

This commit is contained in:
Treehugger Robot 2016-08-23 01:08:18 +00:00 committed by Gerrit Code Review
commit fca43d3ec5
1 changed files with 1 additions and 4 deletions

View File

@ -67,12 +67,9 @@ static int logdOpen()
int i, ret = 0;
if (logdLoggerWrite.context.sock < 0) {
i = TEMP_FAILURE_RETRY(socket(PF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC, 0));
i = TEMP_FAILURE_RETRY(socket(PF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0));
if (i < 0) {
ret = -errno;
} else if (TEMP_FAILURE_RETRY(fcntl(i, F_SETFL, O_NONBLOCK)) < 0) {
ret = -errno;
close(i);
} else {
struct sockaddr_un un;
memset(&un, 0, sizeof(struct sockaddr_un));