From a8cf59620e780cdfde63837a267389e3e84948cc Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Sat, 20 Dec 2003 18:50:41 +0000 Subject: parent: waitpid() for the child processes on exit --- usr.sbin/bgpd/bgpd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.sbin/bgpd/bgpd.c') diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index c8ae1c2e6a7..bd8f77b4911 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.4 2003/12/20 18:32:22 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.5 2003/12/20 18:50:40 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -268,6 +269,10 @@ main(int argc, char *argv[]) if (rde_pid) kill(rde_pid, SIGTERM); + do { + i = waitpid(-1, NULL, WNOHANG); + } while (i > 0 || (i == -1 && errno == EINTR)); + logit(LOG_CRIT, "Terminating"); return (0); } -- cgit v1.2.3