summaryrefslogtreecommitdiffstats
path: root/srUtils.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-09-11 07:34:04 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-09-11 07:34:04 +0000
commit3142387c19602c242ca0bb03e0a1118048e76f74 (patch)
treebee7c4528a2ad1a54f6895919126f6a4258ddd89 /srUtils.c
parentd808cceebff701e5d6bb81be8414509d1381ddf9 (diff)
downloadrsyslog-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-xsrUtils.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/srUtils.c b/srUtils.c
index 0aed9de8..843e6f72 100755
--- a/srUtils.c
+++ b/srUtils.c
@@ -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