The last signal of the list didn't have enough room for him because signal numbers start at 1. Make him some room so sigaction won't fail for him when go lib execute.
Reviewed-by: BenoƮt Canet <[email protected]> --- libc/signal.cc | 4 ++-- libc/signal.hh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/signal.cc b/libc/signal.cc index 66b9fc7..f42baf6 100644 --- a/libc/signal.cc +++ b/libc/signal.cc @@ -33,7 +33,7 @@ __thread __attribute__((aligned(sizeof(sigset)))) // pending signal changes: returning any one is fine __thread int thread_pending_signal; -struct sigaction signal_actions[nsignals]; +struct sigaction signal_actions[nsignals + 1]; sigset* from_libc(sigset_t* s) { @@ -216,7 +216,7 @@ int sigprocmask(int how, const sigset_t* _set, sigset_t* _oldset) int sigaction(int signum, const struct sigaction* act, struct sigaction* oldact) { // FIXME: We do not support any sa_flags besides SA_SIGINFO. - if (signum < 0 || signum >= (int)nsignals) { + if (signum < 0 || signum > (int)nsignals) { errno = EINVAL; return -1; } diff --git a/libc/signal.hh b/libc/signal.hh index 0699b80..0549ad6 100644 --- a/libc/signal.hh +++ b/libc/signal.hh @@ -20,7 +20,7 @@ struct sigset { std::bitset<nsignals> mask; }; -extern struct sigaction signal_actions[nsignals]; +extern struct sigaction signal_actions[nsignals + 1]; sigset* from_libc(sigset_t* s); const sigset* from_libc(const sigset_t* s); -- 2.7.4 -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
