From owner-svn-src-stable@FreeBSD.ORG Wed Oct 19 11:49:14 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB8EE10656A6; Wed, 19 Oct 2011 11:49:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB12A8FC27; Wed, 19 Oct 2011 11:49:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9JBnEuY023248; Wed, 19 Oct 2011 11:49:14 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9JBnEK6023245; Wed, 19 Oct 2011 11:49:14 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201110191149.p9JBnEK6023245@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Wed, 19 Oct 2011 11:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226539 - stable/8/lib/libfetch X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2011 11:49:14 -0000 Author: des Date: Wed Oct 19 11:49:14 2011 New Revision: 226539 URL: http://svn.freebsd.org/changeset/base/226539 Log: MFH r221830: mark all sockets and file descriptors close-on-exec PR: bin/151866 Modified: stable/8/lib/libfetch/common.c stable/8/lib/libfetch/file.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Wed Oct 19 11:48:21 2011 (r226538) +++ stable/8/lib/libfetch/common.c Wed Oct 19 11:49:14 2011 (r226539) @@ -213,6 +213,7 @@ fetch_reopen(int sd) /* allocate and fill connection structure */ if ((conn = calloc(1, sizeof(*conn))) == NULL) return (NULL); + fcntl(sd, F_SETFD, FD_CLOEXEC); conn->sd = sd; ++conn->ref; return (conn); Modified: stable/8/lib/libfetch/file.c ============================================================================== --- stable/8/lib/libfetch/file.c Wed Oct 19 11:48:21 2011 (r226538) +++ stable/8/lib/libfetch/file.c Wed Oct 19 11:49:14 2011 (r226539) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -57,6 +58,7 @@ fetchXGetFile(struct url *u, struct url_ fetch_syserr(); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } @@ -84,6 +86,7 @@ fetchPutFile(struct url *u, const char * fetch_syserr(); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); }