diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-24 20:09:58 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-12-24 20:09:58 +0000 |
commit | b8c6b47a906216a3c6668e007322e2e7298560d7 (patch) | |
tree | fe3a126e16c42ff34de29eafbd01b1bbe21da0c3 /usr.sbin/bgpd/bgpd.c | |
parent | 773b2797d0667b7493ddae968f2d78e5b54c673d (diff) |
now that the main process can cleanup without RDE's help, we do not need the
somewhat fragile IMSG_SHUTDOWN_* stuff any more. speeds shutdown up
enourmously.
ok claudio@
Diffstat (limited to 'usr.sbin/bgpd/bgpd.c')
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 4ee58c247e9..31d60e0bac3 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.24 2003/12/24 19:59:24 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.25 2003/12/24 20:09:56 henning Exp $ */ /* * Copyright (c) 2003 Henning Brauer <henning@openbsd.org> @@ -47,11 +47,6 @@ volatile sig_atomic_t quit = 0; volatile sig_atomic_t reconfig = 0; struct imsgbuf ibuf_se; struct imsgbuf ibuf_rde; -int se_done = 0; -int rde_done = 0; - -#define QUIT_REQUESTED 1 -#define QUIT_INPROGRESS 2 void sighdlr(int sig) @@ -60,7 +55,7 @@ sighdlr(int sig) case SIGTERM: case SIGINT: case SIGCHLD: - quit = QUIT_REQUESTED; + quit = 1; break; case SIGHUP: reconfig = 1; @@ -199,7 +194,7 @@ main(int argc, char *argv[]) imsg_init(&ibuf_rde, pipe_m2r[0]); rfd = kroute_init(); - while (quit != QUIT_INPROGRESS || se_done == 0 || rde_done == 0) { + while (quit == 0) { pfd[PFD_PIPE_SESSION].fd = ibuf_se.sock; pfd[PFD_PIPE_SESSION].events = POLLIN; if (ibuf_se.w.queued) @@ -253,14 +248,6 @@ main(int argc, char *argv[]) reconfig = 0; } - if (quit == QUIT_REQUESTED) { - imsg_compose(&ibuf_se, IMSG_SHUTDOWN_REQUEST, 0, - NULL, 0); - imsg_compose(&ibuf_rde, IMSG_SHUTDOWN_REQUEST, 0, - NULL, 0); - quit = QUIT_INPROGRESS; - } - if (mrtdump == 1) { mrt_alrm(&mrtconf, &ibuf_rde); mrtdump = 0; @@ -365,12 +352,6 @@ dispatch_imsg(struct imsgbuf *ibuf, int idx, struct mrt_config *conf) if (kroute_delete(rfd, imsg.data)) fatal("kroute_delete error", errno); break; - case IMSG_SHUTDOWN_DONE: - if (idx == PFD_PIPE_ROUTE) - rde_done = 1; - else - se_done = 1; - break; default: break; } |