svn commit: r256805 - head/lib/libc/gen

Jilles Tjoelker jilles at FreeBSD.org
Sun Oct 20 21:04:45 UTC 2013


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);


More information about the svn-src-head mailing list