]> granicus.if.org Git - libevent/commitdiff
signal fixes from ericj@monkey.org via dugsong@monkey.org
authorNiels Provos <provos@gmail.com>
Sun, 15 Sep 2002 18:52:28 +0000 (18:52 +0000)
committerNiels Provos <provos@gmail.com>
Sun, 15 Sep 2002 18:52:28 +0000 (18:52 +0000)
svn:r32

select.c

index fc5b6da47d16b4c1d219d0e0a6b32d2663bee5b9..0476c113b6e3f3151fcc09002199582b7337814d 100644 (file)
--- a/select.c
+++ b/select.c
@@ -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;
 }