summaryrefslogtreecommitdiff
path: root/ev.c
diff options
context:
space:
mode:
authorroot <root>2009-12-31 06:50:16 +0000
committerroot <root>2009-12-31 06:50:16 +0000
commit79c861bdfe661c42e87b0a4ec16f2ae74a076839 (patch)
tree38a7a967c8ef8d1974d9395c74097d8ee7c37c3e /ev.c
parent8677f079b7fe2b47d72613d15a71d7b27f14c5eb (diff)
*** empty log message ***
Diffstat (limited to 'ev.c')
-rw-r--r--ev.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ev.c b/ev.c
index aa38d1d..ccd202b 100644
--- a/ev.c
+++ b/ev.c
@@ -1607,7 +1607,7 @@ loop_init (EV_P_ unsigned int flags)
fs_fd = flags & EVFLAG_NOINOTIFY ? -1 : -2;
#endif
#if EV_USE_SIGNALFD
- sigfd = flags & EVFLAG_NOSIGFD ? -1 : -2;
+ sigfd = flags & EVFLAG_SIGNALFD ? -2 : -1;
#endif
if (!(flags & 0x0000ffffU))
@@ -2792,11 +2792,14 @@ ev_signal_stop (EV_P_ ev_signal *w)
#if EV_USE_SIGNALFD
if (sigfd >= 0)
{
- sigprocmask (SIG_UNBLOCK, &sigfd_set, 0);//D
+ sigset_t ss;
+
+ sigemptyset (&ss);
+ sigaddset (&ss, w->signum);
sigdelset (&sigfd_set, w->signum);
+
signalfd (sigfd, &sigfd_set, 0);
- sigprocmask (SIG_BLOCK, &sigfd_set, 0);//D
- /*TODO: maybe unblock signal? */
+ sigprocmask (SIG_UNBLOCK, &ss, 0);
}
else
#endif