Browse Source

close pipe_prnt[0] earlier, foremost before forking the dns process

pointed out by Running Razor <runningrazor at web dot de>
OPENBSD_5_0
henning 13 years ago
parent
commit
42e087b3c6
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/usr.sbin/ntpd/ntp.c

+ 2
- 2
src/usr.sbin/ntpd/ntp.c View File

@ -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]);


Loading…
Cancel
Save