summaryrefslogtreecommitdiffabout
path: root/src/com_start.c
Side-by-side diff
Diffstat (limited to 'src/com_start.c') (more/less context) (show whitespace changes)
-rw-r--r--src/com_start.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com_start.c b/src/com_start.c
index 5744e39..3a9dffc 100644
--- a/src/com_start.c
+++ b/src/com_start.c
@@ -43,9 +43,13 @@ timedwaitpid(pid_t pid, int *status)
{
struct timeval now, stoptime, ttw;
int rc = -1;
- SIGHANDLER oldsig;
+ struct sigaction act, oldact;
+
+ act.sa_handler = sigchld;
+ act.sa_flags = 0;
+ sigemptyset(&act.sa_mask);
+ sigaction(SIGCHLD, &act, &oldact);
- oldsig = signal(SIGCHLD, sigchld);
gettimeofday(&stoptime, NULL);
stoptime.tv_sec += genrc_timeout;
while (1) {
@@ -73,7 +77,7 @@ timedwaitpid(pid_t pid, int *status)
}
}
- signal(SIGCHLD, oldsig);
+ sigaction(SIGCHLD, &oldact, NULL);
if (rc) {
kill(pid, SIGKILL);
}

Return to:

Send suggestions and report system problems to the System administrator.