From a4f37dc057de58a91433035a366bf956c6201d69 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Tue, 11 May 2004 18:30:07 +0000 Subject: [PATCH] set SIGCHLD sigmask to an expected value (SIG_DFL) git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1560 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/src/chcontext.c | 4 +++- util-vserver/src/secure-mount.c | 3 +++ util-vserver/src/vcontext.c | 3 +++ util-vserver/src/vkill.c | 12 ++++++------ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/util-vserver/src/chcontext.c b/util-vserver/src/chcontext.c index cda4c80..4da51d9 100644 --- a/util-vserver/src/chcontext.c +++ b/util-vserver/src/chcontext.c @@ -40,6 +40,7 @@ #include #include #include +#include #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; diff --git a/util-vserver/src/secure-mount.c b/util-vserver/src/secure-mount.c index a7abd19..61cb3eb 100644 --- a/util-vserver/src/secure-mount.c +++ b/util-vserver/src/secure-mount.c @@ -49,6 +49,7 @@ #include #include #include +#include #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; diff --git a/util-vserver/src/vcontext.c b/util-vserver/src/vcontext.c index 05eee72..bc42b47 100644 --- a/util-vserver/src/vcontext.c +++ b/util-vserver/src/vcontext.c @@ -33,6 +33,7 @@ #include #include #include +#include #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); diff --git a/util-vserver/src/vkill.c b/util-vserver/src/vkill.c index cdf77c7..d8998ab 100644 --- a/util-vserver/src/vkill.c +++ b/util-vserver/src/vkill.c @@ -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 && -- 1.8.1.5