diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2014-09-27 11:28:38 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2014-09-27 11:28:38 +0000 |
commit | 1caf1e2fdbc0c05c63421cb09faaaf40fc9e6320 (patch) | |
tree | ce8a9f74678d72e40e28e7afbf0c1be7e536ee1a /usr.sbin | |
parent | 4c8390d23b309a0d80a50e9cca2195f0baed621a (diff) |
Also in debug mode, close nullfd when it is not needed anymore.
OK doug@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/syslogd/privsep.c | 3 | ||||
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/syslogd/privsep.c b/usr.sbin/syslogd/privsep.c index 4283d66b103..c8f07264ec3 100644 --- a/usr.sbin/syslogd/privsep.c +++ b/usr.sbin/syslogd/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.45 2014/09/10 13:16:20 doug Exp $ */ +/* $OpenBSD: privsep.c,v 1.46 2014/09/27 11:28:37 bluhm Exp $ */ /* * Copyright (c) 2003 Anil Madhavapeddy <anil@recoil.org> @@ -153,7 +153,6 @@ priv_init(char *conf, int numeric, int lockfd, int nullfd, char *argv[]) dup2(nullfd, STDOUT_FILENO); dup2(nullfd, STDERR_FILENO); } - if (nullfd > 2) close(nullfd); diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index b8d5768fbb0..3b4f0b9307b 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: syslogd.c,v 1.124 2014/09/10 13:16:20 doug Exp $ */ +/* $OpenBSD: syslogd.c,v 1.125 2014/09/27 11:28:37 bluhm Exp $ */ /* * Copyright (c) 1983, 1988, 1993, 1994 @@ -539,10 +539,10 @@ main(int argc, char *argv[]) dup2(nullfd, STDIN_FILENO); dup2(nullfd, STDOUT_FILENO); dup2(nullfd, STDERR_FILENO); - if (nullfd > 2) - close(nullfd); close(lockpipe[1]); } + if (nullfd > 2) + close(nullfd); /* * Signal to the priv process that the initial config parsing is done |