diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-06-19 13:06:01 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2007-06-19 13:06:01 +0000 |
commit | b87e21b77c7933ec2c6b689122772684efd204f2 (patch) | |
tree | 046611be02791b28abdec2a7bc52323ab8129d00 | |
parent | 25b375222e37db5bb9c4ee80fe5f51f8df4dbb96 (diff) |
don't go through the effort of creating a SIGHUP handler through
libevent just to ignore it, use SIG_IGN instead.
this syncs hoststated with bgpd and (soon) ospfd.
-rw-r--r-- | usr.sbin/hoststated/hce.c | 9 | ||||
-rw-r--r-- | usr.sbin/hoststated/pfe.c | 9 | ||||
-rw-r--r-- | usr.sbin/relayd/hce.c | 9 | ||||
-rw-r--r-- | usr.sbin/relayd/pfe.c | 9 |
4 files changed, 8 insertions, 28 deletions
diff --git a/usr.sbin/hoststated/hce.c b/usr.sbin/hoststated/hce.c index f725c1afa5e..482689fcf66 100644 --- a/usr.sbin/hoststated/hce.c +++ b/usr.sbin/hoststated/hce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hce.c,v 1.28 2007/06/19 06:29:20 pyr Exp $ */ +/* $OpenBSD: hce.c,v 1.29 2007/06/19 13:06:00 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -63,9 +63,6 @@ hce_sig_handler(int sig, short event, void *arg) case SIGTERM: hce_shutdown(); break; - case SIGHUP: - /* nothing */ - break; default: fatalx("hce_sig_handler: unexpected signal"); } @@ -81,7 +78,6 @@ hce(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], int i; struct event ev_sigint; struct event ev_sigterm; - struct event ev_sighup; switch (pid = fork()) { case -1: @@ -140,11 +136,10 @@ hce(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], signal_set(&ev_sigint, SIGINT, hce_sig_handler, NULL); signal_set(&ev_sigterm, SIGTERM, hce_sig_handler, NULL); - signal_set(&ev_sighup, SIGHUP, hce_sig_handler, NULL); signal_add(&ev_sigint, NULL); signal_add(&ev_sigterm, NULL); - signal_add(&ev_sighup, NULL); signal(SIGPIPE, SIG_IGN); + signal(SIGHUP, SIG_IGN); /* setup pipes */ close(pipe_pfe2hce[1]); diff --git a/usr.sbin/hoststated/pfe.c b/usr.sbin/hoststated/pfe.c index 5e967f72e91..0381c6c98f7 100644 --- a/usr.sbin/hoststated/pfe.c +++ b/usr.sbin/hoststated/pfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfe.c,v 1.32 2007/06/19 06:29:20 pyr Exp $ */ +/* $OpenBSD: pfe.c,v 1.33 2007/06/19 13:06:00 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -58,9 +58,6 @@ pfe_sig_handler(int sig, short event, void *arg) case SIGINT: case SIGTERM: pfe_shutdown(); - case SIGHUP: - /* nothing */ - break; default: fatalx("pfe_sig_handler: unexpected signal"); } @@ -75,7 +72,6 @@ pfe(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], struct passwd *pw; struct event ev_sigint; struct event ev_sigterm; - struct event ev_sighup; int i; size_t size; @@ -123,11 +119,10 @@ pfe(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], signal_set(&ev_sigint, SIGINT, pfe_sig_handler, NULL); signal_set(&ev_sigterm, SIGTERM, pfe_sig_handler, NULL); - signal_set(&ev_sighup, SIGHUP, pfe_sig_handler, NULL); signal_add(&ev_sigint, NULL); signal_add(&ev_sigterm, NULL); - signal_add(&ev_sighup, NULL); signal(SIGPIPE, SIG_IGN); + signal(SIGHUP, SIG_IGN); /* setup pipes */ close(pipe_pfe2hce[0]); diff --git a/usr.sbin/relayd/hce.c b/usr.sbin/relayd/hce.c index f725c1afa5e..482689fcf66 100644 --- a/usr.sbin/relayd/hce.c +++ b/usr.sbin/relayd/hce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hce.c,v 1.28 2007/06/19 06:29:20 pyr Exp $ */ +/* $OpenBSD: hce.c,v 1.29 2007/06/19 13:06:00 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -63,9 +63,6 @@ hce_sig_handler(int sig, short event, void *arg) case SIGTERM: hce_shutdown(); break; - case SIGHUP: - /* nothing */ - break; default: fatalx("hce_sig_handler: unexpected signal"); } @@ -81,7 +78,6 @@ hce(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], int i; struct event ev_sigint; struct event ev_sigterm; - struct event ev_sighup; switch (pid = fork()) { case -1: @@ -140,11 +136,10 @@ hce(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], signal_set(&ev_sigint, SIGINT, hce_sig_handler, NULL); signal_set(&ev_sigterm, SIGTERM, hce_sig_handler, NULL); - signal_set(&ev_sighup, SIGHUP, hce_sig_handler, NULL); signal_add(&ev_sigint, NULL); signal_add(&ev_sigterm, NULL); - signal_add(&ev_sighup, NULL); signal(SIGPIPE, SIG_IGN); + signal(SIGHUP, SIG_IGN); /* setup pipes */ close(pipe_pfe2hce[1]); diff --git a/usr.sbin/relayd/pfe.c b/usr.sbin/relayd/pfe.c index 5e967f72e91..0381c6c98f7 100644 --- a/usr.sbin/relayd/pfe.c +++ b/usr.sbin/relayd/pfe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfe.c,v 1.32 2007/06/19 06:29:20 pyr Exp $ */ +/* $OpenBSD: pfe.c,v 1.33 2007/06/19 13:06:00 pyr Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -58,9 +58,6 @@ pfe_sig_handler(int sig, short event, void *arg) case SIGINT: case SIGTERM: pfe_shutdown(); - case SIGHUP: - /* nothing */ - break; default: fatalx("pfe_sig_handler: unexpected signal"); } @@ -75,7 +72,6 @@ pfe(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], struct passwd *pw; struct event ev_sigint; struct event ev_sigterm; - struct event ev_sighup; int i; size_t size; @@ -123,11 +119,10 @@ pfe(struct hoststated *x_env, int pipe_parent2pfe[2], int pipe_parent2hce[2], signal_set(&ev_sigint, SIGINT, pfe_sig_handler, NULL); signal_set(&ev_sigterm, SIGTERM, pfe_sig_handler, NULL); - signal_set(&ev_sighup, SIGHUP, pfe_sig_handler, NULL); signal_add(&ev_sigint, NULL); signal_add(&ev_sigterm, NULL); - signal_add(&ev_sighup, NULL); signal(SIGPIPE, SIG_IGN); + signal(SIGHUP, SIG_IGN); /* setup pipes */ close(pipe_pfe2hce[0]); |