From owner-svn-src-head@FreeBSD.ORG Sun Oct 20 21:04:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 736ACE89; Sun, 20 Oct 2013 21:04:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60F702FA8; Sun, 20 Oct 2013 21:04:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9KL4jck071705; Sun, 20 Oct 2013 21:04:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9KL4jfp071704; Sun, 20 Oct 2013 21:04:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201310202104.r9KL4jfp071704@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Oct 2013 21:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256805 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 21:04:45 -0000 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);