Date: Fri, 2 Feb 2018 18:11:56 +0000 (UTC) From: Mariusz Zaborski <oshogbo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328803 - head/sbin/dhclient Message-ID: <201802021811.w12IBuh6016111@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: oshogbo Date: Fri Feb 2 18:11:56 2018 New Revision: 328803 URL: https://svnweb.freebsd.org/changeset/base/328803 Log: Use daemonfd(3) in the dhclient(8). Reviewed by: brooks@ Differential Revision: https://reviews.freebsd.org/D13603 Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Fri Feb 2 18:10:45 2018 (r328802) +++ head/sbin/dhclient/dhclient.c Fri Feb 2 18:11:56 2018 (r328803) @@ -2430,7 +2430,7 @@ go_daemon(void) /* Stop logging to stderr... */ log_perror = 0; - if (daemon(1, 1) == -1) + if (daemonfd(-1, nullfd) == -1) error("daemon"); cap_rights_init(&rights); @@ -2443,11 +2443,7 @@ go_daemon(void) } } - /* we are chrooted, daemon(3) fails to open /dev/null */ if (nullfd != -1) { - dup2(nullfd, STDIN_FILENO); - dup2(nullfd, STDOUT_FILENO); - dup2(nullfd, STDERR_FILENO); close(nullfd); nullfd = -1; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802021811.w12IBuh6016111>