#define ENSC_WRAPPERS_PREFIX "vnamespace: "
#define ENSC_WRAPPERS_UNISTD 1
+#define ENSC_WRAPPERS_VSERVER 1
#include <wrappers.h>
#ifndef CLONE_NEWNS
}
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);
}
}
case 'n' : do_new = true; break;
case 's' : do_set = true; break;
case 'c' : do_cleanup = true; break;
- case 'e' : do_enter = true; xid = atol(optarg); break;
+ case 'e' :
+ do_enter = true;
+ xid = Evc_xidopt2xid(optarg,true);
+ break;
default :
WRITE_MSG(2, "Try '");
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);