summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2004-01-28 19:24:06 +0000
committerhenning <henning@openbsd.org>2004-01-28 19:24:06 +0000
commit81b38aa6e8d954092d29679280ecaa58b2fdf9b6 (patch)
tree3505dd7b72805b771342e99ba306dcce8ff311bd
parentSTOP events for all sessions before we exit. (diff)
downloadwireguard-openbsd-81b38aa6e8d954092d29679280ecaa58b2fdf9b6.tar.xz
wireguard-openbsd-81b38aa6e8d954092d29679280ecaa58b2fdf9b6.zip
catch SIGINT here as well so we can properly shut down if ^C'ed in debug mode
-rw-r--r--usr.sbin/bgpd/rde.c4
-rw-r--r--usr.sbin/bgpd/session.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 9265d03ed85..e1fbc296253 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.69 2004/01/27 21:56:21 henning Exp $ */
+/* $OpenBSD: rde.c,v 1.70 2004/01/28 19:24:06 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -75,6 +75,7 @@ void
rde_sighdlr(int sig)
{
switch (sig) {
+ case SIGINT:
case SIGTERM:
rde_quit = 1;
break;
@@ -124,6 +125,7 @@ rde_main(struct bgpd_config *config, struct peer *peer_l,
endpwent();
signal(SIGTERM, rde_sighdlr);
+ signal(SIGINT, rde_sighdlr);
close(pipe_s2r[0]);
close(pipe_m2r[0]);
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index c37e3addc94..591209d737e 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.100 2004/01/28 19:18:38 henning Exp $ */
+/* $OpenBSD: session.c,v 1.101 2004/01/28 19:24:06 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -99,6 +99,7 @@ void
session_sighdlr(int sig)
{
switch (sig) {
+ case SIGINT:
case SIGTERM:
session_quit = 1;
break;
@@ -182,6 +183,7 @@ session_main(struct bgpd_config *config, struct peer *cpeers, int pipe_m2s[2],
endpwent();
signal(SIGTERM, session_sighdlr);
+ signal(SIGINT, session_sighdlr);
signal(SIGPIPE, SIG_IGN);
log_info("session engine ready");
close(pipe_m2s[0]);