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 <sys/stat.h> #include <dirent.h> +#include <fcntl.h> #include <stdio.h> #include <string.h> @@ -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); } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"