From: Roy Marples Date: Fri, 28 Mar 2008 11:54:29 +0000 (+0000) Subject: Use the close_on_exec function here. X-Git-Tag: v4.0.2~531 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0cf541d4305fa27980f8c24f829b13cf6fd7881;p=thirdparty%2Fdhcpcd.git Use the close_on_exec function here. --- diff --git a/dhcpcd.c b/dhcpcd.c index 56865860..826c9e94 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -34,7 +34,6 @@ const char copyright[] = "Copyright (c) 2006-2008 Roy Marples"; #include #include -#include #include #include #include @@ -617,11 +616,7 @@ main(int argc, char **argv) goto abort; } - /* dhcpcd.sh should not interhit this fd */ - if ((i = fcntl(pidfd, F_GETFD, 0)) == -1 || - fcntl(pidfd, F_SETFD, i | FD_CLOEXEC) == -1) - logger(LOG_ERR, "fcntl: %s", strerror(errno)); - + close_on_exec(pidfd); writepid(pidfd, getpid()); logger(LOG_INFO, PACKAGE " " VERSION " starting"); }