Skip to content

Commit 2adabed

Browse files
committed
std.process.Child: fix build on non-linux
1 parent 50303dc commit 2adabed

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/std/process/Child.zig

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,10 @@ fn spawnPosix(self: *ChildProcess) SpawnError!void {
824824
// we are the parent
825825
errdefer comptime unreachable; // The child is forked; we must not error from now on
826826

827-
posix.close(err_pipe[1]); // make sure only the child holds the write end open
828-
self.err_pipe = err_pipe[0];
827+
if (!use_clone) {
828+
posix.close(err_pipe[1]); // make sure only the child holds the write end open
829+
self.err_pipe = err_pipe[0];
830+
}
829831

830832
const pid: i32 = @intCast(pid_result);
831833
if (self.stdin_behavior == .Pipe) {
@@ -845,9 +847,6 @@ fn spawnPosix(self: *ChildProcess) SpawnError!void {
845847
}
846848

847849
self.id = pid;
848-
if (!use_clone) {
849-
self.err_pipe = err_pipe;
850-
}
851850
self.term = null;
852851

853852
if (self.stdin_behavior == .Pipe) {

0 commit comments

Comments
 (0)