svn commit: r305707 - head/usr.sbin/syslogd
Baptiste Daroussin
bapt at FreeBSD.org
Sun Sep 11 18:58:45 UTC 2016
Author: bapt
Date: Sun Sep 11 18:58:44 2016
New Revision: 305707
URL: https://svnweb.freebsd.org/changeset/base/305707
Log:
Directly set the O_NONBLOCK flags via open(2)
Modified:
head/usr.sbin/syslogd/syslogd.c
Modified: head/usr.sbin/syslogd/syslogd.c
==============================================================================
--- head/usr.sbin/syslogd/syslogd.c Sun Sep 11 18:56:38 2016 (r305706)
+++ head/usr.sbin/syslogd/syslogd.c Sun Sep 11 18:58:44 2016 (r305707)
@@ -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 */
More information about the svn-src-all
mailing list