From a8a806e925ddb2362e0021bd83dd73f7389a2dbb Mon Sep 17 00:00:00 2001 From: Daniel Ludwig Date: Thu, 3 Sep 2020 08:51:10 +0200 Subject: [PATCH] std.ChildProcess: use "\Device\Null" on Windows --- lib/std/child_process.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/child_process.zig b/lib/std/child_process.zig index ed6a3a739e..9219b05088 100644 --- a/lib/std/child_process.zig +++ b/lib/std/child_process.zig @@ -485,8 +485,8 @@ pub const ChildProcess = struct { const any_ignore = (self.stdin_behavior == StdIo.Ignore or self.stdout_behavior == StdIo.Ignore or self.stderr_behavior == StdIo.Ignore); const nul_handle = if (any_ignore) - windows.OpenFile(&[_]u16{ 'N', 'U', 'L' }, .{ - .dir = std.fs.cwd().fd, + // "\Device\Null" or "\??\NUL" + windows.OpenFile(&[_]u16{ '\\', 'D', 'e', 'v', 'i', 'c', 'e', '\\', 'N', 'u', 'l', 'l' }, .{ .access_mask = windows.GENERIC_READ | windows.SYNCHRONIZE, .share_access = windows.FILE_SHARE_READ, .creation = windows.OPEN_EXISTING,