X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fsrc%2Fvnamespace.c;h=628dbe2f6cf524b5a0cd7be23d9507a911d220d6;hb=5736e97486dbc7182b2e832f4367812741ccbd86;hp=c78ce1d21fe0a2d9ee49e37e6a3054a2f55bc20c;hpb=44e7d56b12c9068077af46c5931f1d01941f1e4e;p=util-vserver.git diff --git a/util-vserver/src/vnamespace.c b/util-vserver/src/vnamespace.c index c78ce1d..628dbe2 100644 --- a/util-vserver/src/vnamespace.c +++ b/util-vserver/src/vnamespace.c @@ -21,7 +21,7 @@ #endif #include "util.h" -#include "sys_clone.h" +#include #include @@ -36,10 +36,6 @@ #define ENSC_WRAPPERS_VSERVER 1 #include -#ifndef CLONE_NEWNS -# define CLONE_NEWNS 0x00020000 -#endif - #define CMD_HELP 0x1000 #define CMD_VERSION 0x1001 @@ -92,9 +88,12 @@ showVersion() } static void -newNamespace() +newNamespace(char const *cmd) { pid_t pid; + + signal(SIGCHLD, SIG_DFL); + #ifdef NDEBUG pid = sys_clone(CLONE_NEWNS|CLONE_VFORK|SIGCHLD, 0); #else @@ -108,7 +107,7 @@ newNamespace() case 0 : break; default : - exitLikeProcess(pid); + exitLikeProcess(pid, cmd, wrapper_exit_code); } } @@ -182,7 +181,7 @@ int main(int argc, char *argv[]) else if (optind==argc && (do_new || do_enter)) WRITE_MSG(2, "No command specified; try '--help' for more information\n"); else { - if (do_new) newNamespace(); + if (do_new) newNamespace(argv[optind]); else if (do_set) setNamespace(); else if (do_cleanup) cleanupNamespace(); else if (do_enter) enterNamespace(xid);