#endif
#include "util.h"
-#include "sys_clone.h"
+#include <lib_internal/sys_clone.h>
#include <vserver.h>
#define ENSC_WRAPPERS_VSERVER 1
#include <wrappers.h>
-#ifndef CLONE_NEWNS
-# define CLONE_NEWNS 0x00020000
-#endif
-
#define CMD_HELP 0x1000
#define CMD_VERSION 0x1001
}
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
case 0 :
break;
default :
- exitLikeProcess(pid);
+ exitLikeProcess(pid, cmd, wrapper_exit_code);
}
}
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);