diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-03-26 11:04:29 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-03-26 11:04:29 +0000 |
commit | 8daf1719efb2f37d6ef507c839a2e40af6aa2252 (patch) | |
tree | 89229555ba160e698fa4e95f5642c32b4d8663e4 /usr.sbin/ospfd | |
parent | 508c684cc8409dae90ba37f4ea177f44f830da0b (diff) |
fix a little race on SIGCHLD where we must delay the claenup until
we invalidated all child pids in case both were killed in a very short
time, spotted by and diff from Michael Knudsen <e@molioner.dk>, claudio ok
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r-- | usr.sbin/ospfd/ospfd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c index 25cbbb6efd8..dc6ca68b070 100644 --- a/usr.sbin/ospfd/ospfd.c +++ b/usr.sbin/ospfd/ospfd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfd.c,v 1.11 2005/03/25 13:39:10 henning Exp $ */ +/* $OpenBSD: ospfd.c,v 1.12 2005/03/26 11:04:28 henning Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -77,6 +77,8 @@ main_sig_handler(int sig, short event, void *arg) * signal handler rules don't apply, libevent decouples for us */ + int die = 0; + switch (sig) { case SIGTERM: case SIGINT: @@ -85,12 +87,14 @@ main_sig_handler(int sig, short event, void *arg) case SIGCHLD: if (check_child(ospfe_pid, "ospf engine")) { ospfe_pid = 0; - ospfd_shutdown(); + die = 1; } if (check_child(rde_pid, "route decision engine")) { rde_pid = 0; - ospfd_shutdown(); + die = 1; } + if (die) + ospfd_shutdown(); break; case SIGHUP: /* reconfigure */ |