Fix lwevent_signalfd(): it should call sigprocmask()
This commit is contained in:
parent
7f76359388
commit
397939b4d5
|
@ -7,11 +7,14 @@
|
|||
|
||||
|
||||
|
||||
#define SIZEOF_SIG (_NSIG / 8)
|
||||
#define SIZEOF_SIGSET (SIZEOF_SIG > sizeof(sigset_t) ? sizeof(sigset_t): SIZEOF_SIG)
|
||||
|
||||
|
||||
|
||||
int signalfd(int fd, const sigset_t* mask)
|
||||
{
|
||||
size_t sz;
|
||||
sz = sizeof(sigset_t);
|
||||
return syscall(__NR_signalfd, fd, mask, sz);
|
||||
return syscall(__NR_signalfd, fd, mask, SIZEOF_SIGSET);
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,6 +76,8 @@ struct lwevent_signal* lwevent_signalfd(const sigset_t* mask, lwevent_signalcb c
|
|||
return 0;
|
||||
}
|
||||
|
||||
TEMP_FAILURE_RETRY( sigprocmask(SIG_BLOCK, &si->mask, 0) );
|
||||
|
||||
lwevent_set_user(si->ev, si);
|
||||
return si;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue