Fix inability to add some signals to mask on NT (#596)

This commit is contained in:
Gavin Hayes 2022-09-06 21:35:26 -04:00 committed by GitHub
parent d861d2787b
commit 598640864a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View file

@ -29,6 +29,8 @@
struct Signals __sig; // TODO(jart): Need TLS
#define GetSigBit(XXSIG) (1ull << (((XXSIG)-1) & 63))
/**
* Changes signal mask for main thread.
* @return 0 on success, or -1 w/ errno
@ -51,7 +53,7 @@ textwindows int __sig_mask(int how, const sigset_t *neu, sigset_t *old) {
__sig.mask.__bits[i] = neu->__bits[i];
}
}
__sig.mask.__bits[0] &= ~(SIGKILL | SIGSTOP);
__sig.mask.__bits[0] &= ~(GetSigBit(SIGKILL) | GetSigBit(SIGSTOP));
}
__sig_unlock();
return 0;
@ -59,3 +61,5 @@ textwindows int __sig_mask(int how, const sigset_t *neu, sigset_t *old) {
return einval();
}
}
#undef GetSigBit