diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-22 21:48:24 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-22 21:48:24 +0000 |
commit | dfc7af5b74ab0a187205c4f64d04e9b4770f836e (patch) | |
tree | 69c746a642014ed00cb6ef79f4b21041a42d30ec /usr.sbin/bgpd/bgpd.c | |
parent | 78c9d0d98e91effb53376813c31bb3035ca8e3ae (diff) |
delay setting up the signal handlers in the main process until after fork(),
pointed out by theo
Diffstat (limited to 'usr.sbin/bgpd/bgpd.c')
-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]); |