diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2009-10-28 20:30:42 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2009-10-28 20:30:42 +0000 |
commit | ebbc25c6050cba15918ed3dcdb3a4c0e88d088e7 (patch) | |
tree | 4b4f6dc254aaa1c5ca42b33daeed9cb6a3b1b83c | |
parent | f8e4e42e8b0ca847c181ac5d25e95bc4c6692b2e (diff) |
Err out if either sigaction fails and not just when both do.
ok otto@
-rw-r--r-- | bin/pax/pax.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/pax/pax.c b/bin/pax/pax.c index f89ca349419..5bbf6cc70e2 100644 --- a/bin/pax/pax.c +++ b/bin/pax/pax.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pax.c,v 1.29 2009/10/27 23:59:22 deraadt Exp $ */ +/* $OpenBSD: pax.c,v 1.30 2009/10/28 20:30:41 guenther Exp $ */ /* $NetBSD: pax.c,v 1.5 1996/03/26 23:54:20 mrg Exp $ */ /*- @@ -385,27 +385,27 @@ gen_init(void) n_hand.sa_flags = 0; n_hand.sa_handler = sig_cleanup; - if ((sigaction(SIGHUP, &n_hand, &o_hand) < 0) && + if ((sigaction(SIGHUP, &n_hand, &o_hand) < 0) || (o_hand.sa_handler == SIG_IGN) && (sigaction(SIGHUP, &o_hand, &o_hand) < 0)) goto out; - if ((sigaction(SIGTERM, &n_hand, &o_hand) < 0) && + if ((sigaction(SIGTERM, &n_hand, &o_hand) < 0) || (o_hand.sa_handler == SIG_IGN) && (sigaction(SIGTERM, &o_hand, &o_hand) < 0)) goto out; - if ((sigaction(SIGINT, &n_hand, &o_hand) < 0) && + if ((sigaction(SIGINT, &n_hand, &o_hand) < 0) || (o_hand.sa_handler == SIG_IGN) && (sigaction(SIGINT, &o_hand, &o_hand) < 0)) goto out; - if ((sigaction(SIGQUIT, &n_hand, &o_hand) < 0) && + if ((sigaction(SIGQUIT, &n_hand, &o_hand) < 0) || (o_hand.sa_handler == SIG_IGN) && (sigaction(SIGQUIT, &o_hand, &o_hand) < 0)) goto out; - if ((sigaction(SIGXCPU, &n_hand, &o_hand) < 0) && + if ((sigaction(SIGXCPU, &n_hand, &o_hand) < 0) || (o_hand.sa_handler == SIG_IGN) && (sigaction(SIGXCPU, &o_hand, &o_hand) < 0)) goto out; |