diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-11 07:34:04 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-09-11 07:34:04 +0000 |
commit | 3142387c19602c242ca0bb03e0a1118048e76f74 (patch) | |
tree | bee7c4528a2ad1a54f6895919126f6a4258ddd89 /srUtils.c | |
parent | d808cceebff701e5d6bb81be8414509d1381ddf9 (diff) | |
download | rsyslog-3142387c19602c242ca0bb03e0a1118048e76f74.tar.gz rsyslog-3142387c19602c242ca0bb03e0a1118048e76f74.tar.xz rsyslog-3142387c19602c242ca0bb03e0a1118048e76f74.zip |
applied patch by varmojfekoj to change signal handling to the new sigaction
API set (replacing the depreciated signal() calls and its friends.
Diffstat (limited to 'srUtils.c')
-rwxr-xr-x | srUtils.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -173,6 +173,7 @@ int execProg(uchar *program, int bWait, uchar *arg) { int pid; int sig; + struct sigaction sigAct; dbgprintf("exec program '%s' with param '%s'\n", program, arg); pid = fork(); @@ -196,8 +197,14 @@ int execProg(uchar *program, int bWait, uchar *arg) } /* Child */ alarm(0); /* create a clean environment before we exec the real child */ - for(sig = 0 ; sig < 32 ; ++sig) - signal(sig, SIG_DFL); + + memset(&sigAct, 0, sizeof(sigAct)); + sigemptyset(&sigAct.sa_mask); + sigAct.sa_handler = SIG_DFL; + + for(sig = 1 ; sig < NSIG ; ++sig) + sigaction(sig, &sigAct, NULL); + execlp((char*)program, (char*) program, (char*)arg, NULL); /* In the long term, it's a good idea to implement some enhanced error * checking here. However, it can not easily be done. For starters, we |