summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/signal.c b/signal.c
index 8535eab..ca34dfa 100644
--- a/signal.c
+++ b/signal.c
@@ -85,19 +85,19 @@ extern void initsignal() {
void (*h)(int);
int i;
- for (i = 1; i < NUMOFSIGNALS; i++) {
- h = sys_signal(i, SIG_DFL);
- if (h != SIG_DFL && h != SIG_ERR)
- sys_signal(i, h);
- sighandlers[i] = h;
- }
-
#if HAVE_SYSV_SIGCLD
/* Ensure that SIGCLD is not SIG_IGN. Solaris's rshd does this. :-( */
- h = sys_signal(SIGCLD, SIG_DFL);
+ h = sys_signal(SIGCLD, SIG_IGN);
if (h != SIG_IGN && h != SIG_ERR)
sys_signal(SIGCLD, h);
else
- sighandlers[SIGCLD] = SIG_DFL;
+ sys_signal(SIGCLD, SIG_DFL);
#endif
+
+ for (i = 1; i < NUMOFSIGNALS; i++) {
+ h = sys_signal(i, SIG_IGN);
+ if (h != SIG_IGN && h != SIG_ERR)
+ sys_signal(i, h);
+ sighandlers[i] = h;
+ }
}