- /* set up sig handler -- but maybe only do this the first time? */
-#ifdef SA_INTERRUPT
- newact.sa_handler = sighandler;
- sigemptyset (&newact.sa_mask);
- newact.sa_flags = 0;
-
- sigaction (SIGCONT, NULL, &oldact);
- if (oldact.sa_handler != SIG_IGN)
- sigaction (SIGCONT, &newact, NULL);
+ /* set up sig handler */
+ if (first_call)
+ {
+#ifdef SA_NOCLDSTOP
+ newact.sa_handler = sighandler;
+ sigemptyset (&newact.sa_mask);
+ newact.sa_flags = 0;
+
+ sigaction (SIGCONT, NULL, &oldact);
+ if (oldact.sa_handler != SIG_IGN)
+ sigaction (SIGCONT, &newact, NULL);