Author: jilles
Date: Sun Oct 20 21:04:44 2013
New Revision: 256805
URL: http://svnweb.freebsd.org/changeset/base/256805

Log:
  syslog: Use SOCK_CLOEXEC instead of separate fcntl() call.

Modified:
  head/lib/libc/gen/syslog.c

Modified: head/lib/libc/gen/syslog.c
==============================================================================
--- head/lib/libc/gen/syslog.c  Sun Oct 20 21:03:15 2013        (r256804)
+++ head/lib/libc/gen/syslog.c  Sun Oct 20 21:04:44 2013        (r256805)
@@ -341,9 +341,9 @@ connectlog(void)
        struct sockaddr_un SyslogAddr;  /* AF_UNIX address of local logger */
 
        if (LogFile == -1) {
-               if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM, 0)) == -1)
+               if ((LogFile = _socket(AF_UNIX, SOCK_DGRAM | SOCK_CLOEXEC,
+                   0)) == -1)
                        return;
-               (void)_fcntl(LogFile, F_SETFD, FD_CLOEXEC);
        }
        if (LogFile != -1 && status == NOCONN) {
                SyslogAddr.sun_len = sizeof(SyslogAddr);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to