svn commit: r307796 - stable/11/usr.sbin/syslogd
Baptiste Daroussin
bapt at FreeBSD.org
Sat Oct 22 20:57:53 UTC 2016
Author: bapt
Date: Sat Oct 22 20:57:51 2016
New Revision: 307796
URL: https://svnweb.freebsd.org/changeset/base/307796
Log:
MFC r305707:
Directly set the O_NONBLOCK flags via open(2)
Modified:
stable/11/usr.sbin/syslogd/syslogd.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/usr.sbin/syslogd/syslogd.c
==============================================================================
--- stable/11/usr.sbin/syslogd/syslogd.c Sat Oct 22 20:56:49 2016 (r307795)
+++ stable/11/usr.sbin/syslogd/syslogd.c Sat Oct 22 20:57:51 2016 (r307796)
@@ -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-stable-11
mailing list