diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2011-06-17 18:12:06 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2011-06-17 18:12:06 +0000 |
commit | 1d8547a03a33fe393e9bb3f4fa25f8326192f2da (patch) | |
tree | afe6cfd7806b1b6ea223fe960dd4c0f0fc2f1da1 /usr.sbin | |
parent | 8d564978851e43aaf7dc702ba1f6218b2bc73a9e (diff) |
close pipe_prnt[0] earlier, foremost before forking the dns process
pointed out by Running Razor <runningrazor at web dot de>
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ntpd/ntp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c index c02cf8dc269..f4c6c88c6d6 100644 --- a/usr.sbin/ntpd/ntp.c +++ b/usr.sbin/ntpd/ntp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntp.c,v 1.115 2011/06/16 11:46:55 henning Exp $ */ +/* $OpenBSD: ntp.c,v 1.116 2011/06/17 18:12:05 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -110,6 +110,7 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf, struct passwd *pw) fatal(NULL); hotplugfd = sensor_hotplugfd(); + close(pipe_prnt[0]); if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pipe_dns) == -1) fatal("socketpair"); dns_pid = ntp_dns(pipe_dns, nconf, pw); @@ -150,7 +151,6 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf, struct passwd *pw) signal(SIGHUP, SIG_IGN); signal(SIGCHLD, SIG_DFL); - close(pipe_prnt[0]); if ((ibuf_main = malloc(sizeof(struct imsgbuf))) == NULL) fatal(NULL); imsg_init(ibuf_main, pipe_prnt[1]); |