summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2010-01-10 00:36:36 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2010-01-10 00:36:36 +0000
commit11f7362a3bdd215142b66c71001c8984508cd771 (patch)
tree1379ed00f2ac86ee67ce6038cef3757db5afb08e
parentd1c662a8844fdccea09098f826cfdfe7d39faa9c (diff)
Fix evsignal_del()'s use of sigaction(): fill in a sigaction struct
and pass a pointer to that instead of passing SIG_DFL directly. (Probably the result of a bad signal()-->sigaction() translation...) ok deraadt@, nicm@, miod@
-rw-r--r--lib/libevent/signal.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libevent/signal.c b/lib/libevent/signal.c
index f3b2b9055f0..ee9c57552fd 100644
--- a/lib/libevent/signal.c
+++ b/lib/libevent/signal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signal.c,v 1.12 2008/05/02 06:09:11 brad Exp $ */
+/* $OpenBSD: signal.c,v 1.13 2010/01/10 00:36:35 guenther Exp $ */
/*
* Copyright 2000-2002 Niels Provos <provos@citi.umich.edu>
@@ -138,7 +138,12 @@ evsignal_add(struct event *ev)
int
evsignal_del(struct event *ev)
{
- return (sigaction(EVENT_SIGNAL(ev),(struct sigaction *)SIG_DFL, NULL));
+ struct sigaction sa;
+
+ memset(&sa, 0, sizeof(sa));
+ sigemptyset(&sa.sa_mask);
+ sa.sa_handler = SIG_DFL;
+ return (sigaction(EVENT_SIGNAL(ev), &sa, NULL));
}
static void