posix_spawn(): use MAX_SIGNAL_NUMBER instead of NSIG.
* fish now works with posix_spawn().
This commit is contained in:
parent
67379bfbd0
commit
4bb883d9bf
|
@ -13,6 +13,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <signal_defs.h>
|
||||||
#include <syscalls.h>
|
#include <syscalls.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -345,7 +346,7 @@ process_spawnattr(const posix_spawnattr_t *_attr)
|
||||||
action.sa_flags = 0;
|
action.sa_flags = 0;
|
||||||
action.sa_userdata = NULL;
|
action.sa_userdata = NULL;
|
||||||
sigemptyset(&action.sa_mask);
|
sigemptyset(&action.sa_mask);
|
||||||
for (int i = 1; i <= NSIG; i++) {
|
for (int i = 1; i <= MAX_SIGNAL_NUMBER; i++) {
|
||||||
if (sigismember(&attr->sigdefault, i) == 1
|
if (sigismember(&attr->sigdefault, i) == 1
|
||||||
&& sigaction(i, &action, NULL) != 0) {
|
&& sigaction(i, &action, NULL) != 0) {
|
||||||
return errno;
|
return errno;
|
||||||
|
|
Loading…
Reference in New Issue