diff options
author | bapt <bapt@FreeBSD.org> | 2016-10-22 20:57:51 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2016-10-22 20:57:51 +0000 |
commit | 44b6cd95061e8e040744716afe3700293f91d8d3 (patch) | |
tree | a428439b0c9944d32e4573298f242c2bf98faa66 /usr.sbin | |
parent | f7c8de659218f4b83cf08f536c611d4b06a07010 (diff) | |
download | FreeBSD-src-44b6cd95061e8e040744716afe3700293f91d8d3.zip FreeBSD-src-44b6cd95061e8e040744716afe3700293f91d8d3.tar.gz |
MFC r305707:
Directly set the O_NONBLOCK flags via open(2)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index df01676..5562781 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -621,10 +621,7 @@ main(int argc, char *argv[]) dprintf("sending on inet and/or inet6 socket\n"); } - if ((fklog = open(_PATH_KLOG, O_RDONLY, 0)) >= 0) - if (fcntl(fklog, F_SETFL, O_NONBLOCK) < 0) - fklog = -1; - if (fklog < 0) + if ((fklog = open(_PATH_KLOG, O_RDONLY|O_NONBLOCK, 0)) < 0) dprintf("can't open %s (%d)\n", _PATH_KLOG, errno); /* tuck my process id away */ |