From 410ff8d8e2715a88fd3194f1a7a96cec047fb67b Mon Sep 17 00:00:00 2001 From: des Date: Fri, 13 May 2011 07:21:41 +0000 Subject: Mark all socket and file descriptors close-on-exec. PR: bin/151866 MFC after: 3 weeks --- lib/libfetch/file.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libfetch/file.c') diff --git a/lib/libfetch/file.c b/lib/libfetch/file.c index a1492ba..dffaad8 100644 --- a/lib/libfetch/file.c +++ b/lib/libfetch/file.c @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -57,6 +58,7 @@ fetchXGetFile(struct url *u, struct url_stat *us, const char *flags) fetch_syserr(); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } @@ -84,6 +86,7 @@ fetchPutFile(struct url *u, const char *flags) fetch_syserr(); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } -- cgit v1.1