Fix mistakes in usage of sigprocmask()

This commit is contained in:
Laurence Withers 2007-11-05 10:43:19 +00:00
parent 3fc440edab
commit 43e1630cd6
1 changed files with 4 additions and 4 deletions

View File

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