if (!do_disconnect) return;
- fd = Eopen("/dev/null", O_RDONLY|O_NONBLOCK, 0);
- Esetsid();
+ fd = EopenD("/dev/null", O_RDONLY|O_NONBLOCK, 0);
+ (void)setsid(); // ignore error when we are already a session-leader
Edup2(fd, 0);
Eclose(p[1][0]);
if (fd!=0) Eclose(fd);
Eclose(p[1][1]);
l = Eread(p[1][0], &c, 1);
- if (l!=1) exitLikeProcess(pid);
+ if (l!=1) exitLikeProcess(pid,0, wrapper_exit_code);
l = Eread(p[1][0], &c, 1);
- if (l!=0) exitLikeProcess(pid);
+ if (l!=0) exitLikeProcess(pid,0, wrapper_exit_code);
}