Eclose(p[1][1]);
l = Eread(p[1][0], &c, 1);
- if (l!=1) exitLikeProcess(pid,0);
+ if (l!=1) exitLikeProcess(pid,0, wrapper_exit_code);
l = Eread(p[1][0], &c, 1);
- if (l!=0) exitLikeProcess(pid,0);
+ if (l!=0) exitLikeProcess(pid,0, wrapper_exit_code);
}
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, cmd);
+ exitLikeProcess(pid, cmd, wrapper_exit_code);
}
}
#include <lib/fmt.h>
#include <assert.h>
#include <fcntl.h>
+#include <signal.h>
#define ENSC_WRAPPERS_VSERVER 1
#define ENSC_WRAPPERS_STDLIB 1
if (strcmp(argv[1], "--version")==0) showVersion();
}
+ signal(SIGCHLD, SIG_DFL);
+
if (!switchToWatchXid(&errptr)) {
perror(errptr);
exit(wrapper_exit_code);
Eclose(p[0]);
processOutput(data, len);
-
- exitLikeProcess(pid, "ps");
- perror("exitLikeProcess()");
- return wrapper_exit_code;
+ exitLikeProcess(pid, "ps", wrapper_exit_code);
}