river: fix SIGPIPE handling, cleanup fork/execve
Installing an empty handler does not have the same effect as using SIG_IGN as the failing write syscall will not return EPIPE.
This commit is contained in:
@ -40,10 +40,7 @@ pub fn spawn(
|
||||
};
|
||||
|
||||
if (pid == 0) {
|
||||
// Clean things up for the child in an intermediate fork
|
||||
if (c.setsid() < 0) unreachable;
|
||||
if (os.system.sigprocmask(os.SIG.SETMASK, &os.empty_sigset, null) < 0) unreachable;
|
||||
|
||||
util.post_fork_pre_execve();
|
||||
const pid2 = os.fork() catch c._exit(1);
|
||||
if (pid2 == 0) os.execveZ("/bin/sh", &child_args, std.c.environ) catch c._exit(1);
|
||||
|
||||
|
Reference in New Issue
Block a user