Fix mistakes in usage of sigprocmask()
This commit is contained in:
parent
3fc440edab
commit
43e1630cd6
|
@ -95,7 +95,7 @@ lwevent_signalcb lwevent_signalfd_getcb(const struct lwevent_signal* si)
|
|||
|
||||
int lwevent_signalfd_setsigs(struct lwevent_signal* si, const sigset_t* mask)
|
||||
{
|
||||
sigset_t mnew, munmask, mmask;
|
||||
sigset_t mnew;
|
||||
|
||||
mnew = *mask;
|
||||
sigdelset(&mnew, SIGBUS);
|
||||
|
@ -106,9 +106,9 @@ int lwevent_signalfd_setsigs(struct lwevent_signal* si, const sigset_t* mask)
|
|||
if(TEMP_FAILURE_RETRY( signalfd(lwevent_get_fd(si->ev), &mnew) )) return -1;
|
||||
|
||||
/* unmask old signals, mask new ones */
|
||||
TEMP_FAILURE_RETRY( sigprocmask(SIG_UNBLOCK, &si->mask) );
|
||||
TEMP_FAILURE_RETRY( sigprocmask(SIG_UNBLOCK, &si->mask, 0) );
|
||||
si->mask = mnew;
|
||||
TEMP_FAILURE_RETRY( sigprocmask(SIG_BLOCK, &si->mask) );
|
||||
TEMP_FAILURE_RETRY( sigprocmask(SIG_BLOCK, &si->mask, 0) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ void lwevent_signalfd_close(struct lwevent_signal* si)
|
|||
{
|
||||
if(!si) return;
|
||||
|
||||
TEMP_FAILURE_RETRY( sigprocmask(SIG_UNBLOCK, &si->mask) );
|
||||
TEMP_FAILURE_RETRY( sigprocmask(SIG_UNBLOCK, &si->mask, 0) );
|
||||
|
||||
lwevent_free(si->ev);
|
||||
free(si);
|
||||
|
|
Loading…
Reference in New Issue