##// END OF EJS Templates
chg: initialize sigaction fields more reliably...
Yuya Nishihara -
r28084:3fc45956 default
parent child Browse files
Show More
@@ -241,6 +241,7 b' static void setupsignalhandler(pid_t pid'
241 241 memset(&sa, 0, sizeof(sa));
242 242 sa.sa_handler = forwardsignal;
243 243 sa.sa_flags = SA_RESTART;
244 sigemptyset(&sa.sa_mask);
244 245
245 246 sigaction(SIGHUP, &sa, NULL);
246 247 sigaction(SIGINT, &sa, NULL);
@@ -11,6 +11,7 b''
11 11 #include <stdarg.h>
12 12 #include <stdio.h>
13 13 #include <stdlib.h>
14 #include <string.h>
14 15 #include <sys/types.h>
15 16 #include <sys/wait.h>
16 17 #include <unistd.h>
@@ -63,6 +64,7 b' int runshellcmd(const char *cmd, const c'
63 64 sigset_t oldmask;
64 65
65 66 /* block or mask signals just as system() does */
67 memset(&newsa, 0, sizeof(newsa));
66 68 newsa.sa_handler = SIG_IGN;
67 69 newsa.sa_flags = 0;
68 70 if (sigemptyset(&newsa.sa_mask) < 0)
General Comments 0
You need to be logged in to leave comments. Login now