From fafe86ce27c2bf5bdfea02b6e82f0d65d3201226 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sun, 11 Sep 2016 18:58:44 +0000 Subject: [PATCH] Directly set the O_NONBLOCK flags via open(2) --- usr.sbin/syslogd/syslogd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index df01676dd079..556278159364 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 */