From 1a0cb582fd7468efb5010e6b434db6f2e5a31e0f Mon Sep 17 00:00:00 2001 From: renato Date: Mon, 8 Aug 2016 21:44:00 +0000 Subject: [PATCH] Use exit(3) instead of _exit(2) in the child processes. Since recently the child processes call exec() after fork(), so they should stop using _exit(2) and use exit(3) instead when shutting down. Ok claudio@ --- usr.sbin/bgpd/log.c | 7 ++----- usr.sbin/bgpd/rde.c | 4 ++-- usr.sbin/bgpd/session.c | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/usr.sbin/bgpd/log.c b/usr.sbin/bgpd/log.c index f372844e773..025cf1d2ce4 100644 --- a/usr.sbin/bgpd/log.c +++ b/usr.sbin/bgpd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.59 2015/07/18 22:52:39 benno Exp $ */ +/* $OpenBSD: log.c,v 1.60 2016/08/08 21:44:00 renato Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -227,10 +227,7 @@ fatal(const char *emsg, ...) logit(LOG_CRIT, "fatal in %s: %s", procnames[bgpd_process], s); - if (bgpd_process == PROC_MAIN) - exit(1); - else /* parent copes via SIGCHLD */ - _exit(1); + exit(1); } void diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 50f4bc22589..0b19f569787 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.347 2016/07/21 10:13:58 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.348 2016/08/08 21:44:00 renato Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -329,7 +329,7 @@ rde_main(int debug, int verbose) free(ibuf_main); log_info("route decision engine exiting"); - _exit(0); + exit(0); } struct network_config netconf_s, netconf_p; diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index e70c9db13d7..a99a26a83c8 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.351 2016/07/25 14:29:28 claudio Exp $ */ +/* $OpenBSD: session.c,v 1.352 2016/08/08 21:44:00 renato Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer @@ -582,7 +582,7 @@ session_main(int debug, int verbose) control_shutdown(csock); control_shutdown(rcsock); log_info("session engine exiting"); - _exit(0); + exit(0); } void -- 2.20.1