set SIGCHLD sigmask to an expected value (SIG_DFL)
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 11 May 2004 18:30:07 +0000 (18:30 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 11 May 2004 18:30:07 +0000 (18:30 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1560 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/src/chcontext.c
util-vserver/src/secure-mount.c
util-vserver/src/vcontext.c
util-vserver/src/vkill.c

index cda4c80..4da51d9 100644 (file)
@@ -40,6 +40,7 @@
 #include <assert.h>
 #include <fcntl.h>
 #include <libgen.h>
+#include <signal.h>
 
 #define ENSC_WRAPPERS_PREFIX   "chcontext: "
 #define ENSC_WRAPPERS_VSERVER  1
@@ -283,7 +284,8 @@ int main (int argc, char *argv[])
   pid_t                pid;
   
   global_args = &args;
-  
+  signal(SIGCHLD, SIG_DFL);
+
   while (1) {
     int                c = getopt_long(argc, argv, "+", CMDLINE_OPTIONS, 0);
     if (c==-1) break;
index a7abd19..61cb3eb 100644 (file)
@@ -49,6 +49,7 @@
 #include <ctype.h>
 #include <sys/wait.h>
 #include <libgen.h>
+#include <signal.h>
 
 #define MNTPOINT       "/etc"
 
@@ -594,6 +595,8 @@ int main(int argc, char *argv[])
     return EXIT_FAILURE;
   }
 
+  signal(SIGCHLD, SIG_DFL);
+
   while (1) {
     int                c = getopt_long(argc, argv, "ht:nao:", CMDLINE_OPTIONS, 0);
     if (c==-1) break;
index 05eee72..bc42b47 100644 (file)
@@ -33,6 +33,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <assert.h>
+#include <signal.h>
 
 #define ENSC_WRAPPERS_PREFIX   "vcontext: "
 #define ENSC_WRAPPERS_UNISTD   1
@@ -324,6 +325,8 @@ int main (int argc, char *argv[])
     }
   }
 
+  signal(SIGCHLD, SIG_DFL);
+  
   if (args.do_migrateself)
     args.xid = Evc_get_task_xid(0);
   
index cdf77c7..d8998ab 100644 (file)
@@ -112,12 +112,12 @@ str2sig(char const *str)
 inline static ALWAYSINLINE int
 kill_wrapper_legacy(xid_t UNUSED xid, char const *proc, int UNUSED sig)
 {
-  pid_t                pid = fork();
-  if (pid==-1) {
-    perror("vkill: fork()");
-    exit(1);
-  }
-  else if (pid==0) {
+  pid_t                pid;
+
+  signal(SIGCHLD, SIG_DFL);
+  pid = Efork();
+
+  if (pid==0) {
     int                status;
     int                res;
     while ((res=wait4(pid, &status, 0,0))==-1 &&