After all, we usually don't check for failures here, and it is better to
do as much as we can...
}
int reset_all_signal_handlers(void) {
}
int reset_all_signal_handlers(void) {
for (sig = 1; sig < _NSIG; sig++) {
struct sigaction sa = {
for (sig = 1; sig < _NSIG; sig++) {
struct sigaction sa = {
.sa_flags = SA_RESTART,
};
.sa_flags = SA_RESTART,
};
+ /* These two cannot be caught... */
if (sig == SIGKILL || sig == SIGSTOP)
continue;
/* On Linux the first two RT signals are reserved by
* glibc, and sigaction() will return EINVAL for them. */
if ((sigaction(sig, &sa, NULL) < 0))
if (sig == SIGKILL || sig == SIGSTOP)
continue;
/* On Linux the first two RT signals are reserved by
* glibc, and sigaction() will return EINVAL for them. */
if ((sigaction(sig, &sa, NULL) < 0))
- if (errno != EINVAL)
- return -errno;
+ if (errno != EINVAL && r == 0)
+ r = -errno;
}
char *strstrip(char *s) {
}
char *strstrip(char *s) {