Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Oct 2013 21:04:45 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256805 - head/lib/libc/gen
Message-ID:  <201310202104.r9KL4jfp071704@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310202104.r9KL4jfp071704>