diff options
author | 2003-12-22 21:48:23 +0000 | |
---|---|---|
committer | 2003-12-22 21:48:23 +0000 | |
commit | 4ed494810c952571a3d10651d94d7993002b13e5 (patch) | |
tree | 92f3e75b2ea3364607dee091f049a9d4eb4804df | |
parent | Fix from FreeBSD' libc_r (diff) | |
download | wireguard-openbsd-4ed494810c952571a3d10651d94d7993002b13e5.tar.xz wireguard-openbsd-4ed494810c952571a3d10651d94d7993002b13e5.zip |
delay setting up the signal handlers in the main process until after fork(),
pointed out by theo
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 5c4660f0f48..41524c49e32 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.18 2003/12/22 15:22:13 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.19 2003/12/22 21:48:23 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -147,13 +147,6 @@ main(int argc, char *argv[]) if (geteuid()) errx(1, "need root privileges"); - signal(SIGTERM, sighdlr); - signal(SIGINT, sighdlr); - signal(SIGCHLD, sighdlr); - signal(SIGHUP, sighdlr); - signal(SIGALRM, sighdlr); - signal(SIGUSR1, sighdlr); - log_init(debug); if (!debug) @@ -185,6 +178,13 @@ main(int argc, char *argv[]) setproctitle("parent"); + signal(SIGTERM, sighdlr); + signal(SIGINT, sighdlr); + signal(SIGCHLD, sighdlr); + signal(SIGHUP, sighdlr); + signal(SIGALRM, sighdlr); + signal(SIGUSR1, sighdlr); + close(pipe_m2s[1]); close(pipe_m2r[1]); close(pipe_s2r[0]); |