X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fsrc%2Fvkill.c;h=a95f8a71a25bdf06704bb547c34e1671e97c7640;hb=0e981c77a8a6215525e86fbe432cda11ee3ede40;hp=cdf77c7e134695a29b343ada86e579b86e190745;hpb=f242c493e4feccf2bef4ad10ce8d64c2e3ecc56e;p=util-vserver.git diff --git a/util-vserver/src/vkill.c b/util-vserver/src/vkill.c index cdf77c7..a95f8a7 100644 --- a/util-vserver/src/vkill.c +++ b/util-vserver/src/vkill.c @@ -36,6 +36,7 @@ #include #define ENSC_WRAPPERS_VSERVER 1 +#define ENSC_WRAPPERS_UNISTD 1 #include #define CMD_HELP 0x8000 @@ -112,12 +113,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 &&