summaryrefslogtreecommitdiff
path: root/lib/libevent/select.c
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-09-15 18:58:21 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-09-15 18:58:21 +0000
commit41698581702170a46fdd0a95e7291e6e86ecd8c7 (patch)
tree38995bd8b0f5ec6b60636d421fb0b979bbf2ca66 /lib/libevent/select.c
parent68d266c631fc526a59d09f89c03e11835613fbfd (diff)
Signal fixes from ericj@monkey.org via dugsong@monkey.org
via provos
Diffstat (limited to 'lib/libevent/select.c')
-rw-r--r--lib/libevent/select.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libevent/select.c b/lib/libevent/select.c
index fc5b6da47d1..83a93cd2a0b 100644
--- a/lib/libevent/select.c
+++ b/lib/libevent/select.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: select.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */
+/* $OpenBSD: select.c,v 1.3 2002/09/15 18:58:20 itojun Exp $ */
/*
* Copyright 2000-2002 Niels Provos <provos@citi.umich.edu>
@@ -60,6 +60,7 @@ extern struct event_list signalqueue;
#endif
short evsigcaught[NSIG];
+volatile sig_atomic_t signal_caught = 0;
struct selectop {
int event_fds; /* Highest fd in fd set */
@@ -180,7 +181,8 @@ select_dispatch(void *arg, struct timeval *tv)
signal_process();
return (0);
- }
+ } else if (signal_caught)
+ signal_process();
LOG_DBG((LOG_MISC, 80, __FUNCTION__": select reports %d",
res));
@@ -260,6 +262,7 @@ static void
signal_handler(int sig)
{
evsigcaught[sig]++;
+ signal_caught = 1;
}
int
@@ -307,5 +310,6 @@ signal_process(void)
}
memset(evsigcaught, 0, sizeof(evsigcaught));
+ signal_caught = 0;
}