Commit e99e9bac authored by Brad King's avatar Brad King
Browse files

BUG: Added missing zero-initialization of struct sigaction.

parent dfcd4f21
...@@ -285,6 +285,7 @@ void kwsysProcess_Execute(kwsysProcess* cp) ...@@ -285,6 +285,7 @@ void kwsysProcess_Execute(kwsysProcess* cp)
/* We want no special handling of SIGCHLD. Repeat call until it is /* We want no special handling of SIGCHLD. Repeat call until it is
not interrupted. */ not interrupted. */
memset(&newSigChldAction, 0, sizeof(struct sigaction));
newSigChldAction.sa_handler = SIG_DFL; newSigChldAction.sa_handler = SIG_DFL;
while((sigaction(SIGCHLD, &newSigChldAction, &cp->OldSigChldAction) < 0) && while((sigaction(SIGCHLD, &newSigChldAction, &cp->OldSigChldAction) < 0) &&
(errno == EINTR)); (errno == EINTR));
...@@ -901,6 +902,7 @@ static void kwsysProcessChildErrorExit(kwsysProcess* cp) ...@@ -901,6 +902,7 @@ static void kwsysProcessChildErrorExit(kwsysProcess* cp)
static void kwsysProcessRestoreDefaultSignalHandlers() static void kwsysProcessRestoreDefaultSignalHandlers()
{ {
struct sigaction act; struct sigaction act;
memset(&act, 0, sizeof(struct sigaction));
act.sa_handler = SIG_DFL; act.sa_handler = SIG_DFL;
#ifdef SIGHUP #ifdef SIGHUP
sigaction(SIGHUP, &act, 0); sigaction(SIGHUP, &act, 0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment