use fd3 for synchronisation
enable fork on default
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@547
94cd875c-1c1d-0410-91d2-
eb244daf1a30
uint8_t c;
while (true) {
- Ewrite(2, ".", 1);
+ Ewrite(3, ".", 1);
Eread (0, &c, sizeof c);
switch (c) {
case 'P' : do_getpwnam(); break;
static void
daemonize(struct ArgInfo const UNUSED * args, int pid_fd)
{
- pid_t pid = Efork();
+ int p[2];
+ pid_t pid;
+ char c;
+
+ Epipe(p);
+ pid = Efork();
+
if (pid!=0) {
if (pid_fd!=-1) {
char buf[sizeof(id_t)*3 + 2];
}
_exit(0);
}
+ Eclose(p[1]);
+ read(p[0], &c, 1);
+ Eclose(p[0]);
}
int main(int argc, char * argv[])
.ctx = VC_RANDCTX,
.uid = 99,
.gid = 99,
- .do_fork = false,
+ .do_fork = true,
.pid_file = 0,
.chroot = 0
};