fix windows build from previous commit

This commit is contained in:
Andrew Kelley 2017-10-31 22:24:02 -04:00
parent 9e234d4208
commit 25972be45c

View File

@ -219,8 +219,8 @@ pub const ChildProcess = struct {
} }
}); });
os.windowsClose(self.handle); os.close(self.handle);
os.windowsClose(self.thread_handle); os.close(self.thread_handle);
self.cleanupStreams(); self.cleanupStreams();
return result; return result;
} }
@ -417,7 +417,7 @@ pub const ChildProcess = struct {
} else { } else {
undefined undefined
}; };
defer { if (any_ignore) os.windowsClose(nul_handle); }; defer { if (any_ignore) os.close(nul_handle); };
if (any_ignore) { if (any_ignore) {
%return windowsSetHandleInfo(nul_handle, windows.HANDLE_FLAG_INHERIT, 0); %return windowsSetHandleInfo(nul_handle, windows.HANDLE_FLAG_INHERIT, 0);
} }
@ -556,18 +556,18 @@ pub const ChildProcess = struct {
} }
}; };
if (self.stdin_behavior == StdIo.Pipe) { if (g_hChildStd_IN_Wr) |h| {
self.stdin = io.File.openHandle(g_hChildStd_IN_Wr); self.stdin = io.File.openHandle(h);
} else { } else {
self.stdin = null; self.stdin = null;
} }
if (self.stdout_behavior == StdIo.Pipe) { if (g_hChildStd_OUT_Rd) |h| {
self.stdout = io.File.openHandle(g_hChildStd_OUT_Rd); self.stdout = io.File.openHandle(h);
} else { } else {
self.stdout = null; self.stdout = null;
} }
if (self.stderr_behavior == StdIo.Pipe) { if (g_hChildStd_ERR_Rd) |h| {
self.stderr = io.File.openHandle(g_hChildStd_ERR_Rd); self.stderr = io.File.openHandle(h);
} else { } else {
self.stderr = null; self.stderr = null;
} }
@ -576,9 +576,9 @@ pub const ChildProcess = struct {
self.thread_handle = piProcInfo.hThread; self.thread_handle = piProcInfo.hThread;
self.term = null; self.term = null;
if (self.stdin_behavior == StdIo.Pipe) { os.windowsClose(??g_hChildStd_IN_Rd); } if (self.stdin_behavior == StdIo.Pipe) { os.close(??g_hChildStd_IN_Rd); }
if (self.stderr_behavior == StdIo.Pipe) { os.windowsClose(??g_hChildStd_ERR_Wr); } if (self.stderr_behavior == StdIo.Pipe) { os.close(??g_hChildStd_ERR_Wr); }
if (self.stdout_behavior == StdIo.Pipe) { os.windowsClose(??g_hChildStd_OUT_Wr); } if (self.stdout_behavior == StdIo.Pipe) { os.close(??g_hChildStd_OUT_Wr); }
} }
fn setUpChildIo(stdio: StdIo, pipe_fd: i32, std_fileno: i32, dev_null_fd: i32) -> %void { fn setUpChildIo(stdio: StdIo, pipe_fd: i32, std_fileno: i32, dev_null_fd: i32) -> %void {
@ -647,8 +647,8 @@ fn windowsCreateCommandLine(allocator: &Allocator, argv: []const []const u8) ->
} }
fn windowsDestroyPipe(rd: ?windows.HANDLE, wr: ?windows.HANDLE) { fn windowsDestroyPipe(rd: ?windows.HANDLE, wr: ?windows.HANDLE) {
if (rd) |h| os.windowsClose(h); if (rd) |h| os.close(h);
if (wr) |h| os.windowsClose(h); if (wr) |h| os.close(h);
} }