Fix lwevent_signalfd(): it should call sigprocmask()

This commit is contained in:
Laurence Withers 2007-11-07 21:33:33 +00:00
parent 7f76359388
commit 397939b4d5
1 changed files with 8 additions and 3 deletions

View File

@ -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;
}