diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-09-23 01:53:08 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-09-23 01:53:08 +0000 |
commit | d9df44daa86b9b61747e1340fd7220b04c1916ab (patch) | |
tree | 26efdf694106ae42fdf2d3649efd5798ffb104bb /usr.sbin/ntpd/ntpd.c | |
parent | d26b16906b2691c7f6f8162719309a191b4dc9d0 (diff) |
reset chld_pid to 0 when acting upon a SIGCHLD so we don't try to send it
a kill then - tiny possible race there
pointed out by Brian Poole <raj@cerias.purdue.edu>
Diffstat (limited to 'usr.sbin/ntpd/ntpd.c')
-rw-r--r-- | usr.sbin/ntpd/ntpd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c index a87f908b5a4..bedfa073a54 100644 --- a/usr.sbin/ntpd/ntpd.c +++ b/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.21 2004/09/18 23:21:35 henning Exp $ */ +/* $OpenBSD: ntpd.c,v 1.22 2004/09/23 01:53:07 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -186,8 +186,10 @@ main(int argc, char *argv[]) } if (sigchld) { - if (check_child(chld_pid, "child")) + if (check_child(chld_pid, "child")) { quit = 1; + chld_pid = 0; + } sigchld = 0; } |