summaryrefslogtreecommitdiff
path: root/usr.sbin/syslogd/syslogd.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2015-06-12 19:20:44 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2015-06-12 19:20:44 +0000
commiteca9b42d8764fa5e8922d941a356da0a74f851e9 (patch)
tree4b4ab15e79eb974f531294f993a839978a7dcc48 /usr.sbin/syslogd/syslogd.c
parent81020b311ae911aa255d831fd51e6694219ec9e8 (diff)
Close the lock pipe before dupping /dev/null to stdio.
This works even if the file descriptor is 0 or 1 or 2. input and OK millert@
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r--usr.sbin/syslogd/syslogd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 0ed55138e98..7ef38cf477a 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogd.c,v 1.162 2015/06/12 00:54:28 bluhm Exp $ */
+/* $OpenBSD: syslogd.c,v 1.163 2015/06/12 19:20:43 bluhm Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -629,10 +629,10 @@ main(int argc, char *argv[])
reply_text = ctl_reply + CTL_HDR_LEN;
if (!Debug) {
+ close(lockpipe[1]);
dup2(nullfd, STDIN_FILENO);
dup2(nullfd, STDOUT_FILENO);
dup2(nullfd, STDERR_FILENO);
- close(lockpipe[1]);
}
if (nullfd > 2)
close(nullfd);