authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-12-22 02:33:39-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-12-22 02:33:39-05:00
logea805c5fe7a8e24597fcd59f064efc2a7dca3859
treec1c6a853df1f6786315a2f6b3fa0bfad44d246ad
parentd917815d8111b98dc237cbe2c723fa63018e02b1

fix darwin and windows from previous commit


3 files changed, 13 insertions(+), 11 deletions(-)

std/os/child_process.zig+8-6
......@@ -560,12 +560,14 @@ pub const ChildProcess = struct {
560560
561561 // the cwd set in ChildProcess is in effect when choosing the executable path
562562 // to match posix semantics
563 const app_name = if (self.cwd) |cwd| x: {
564 const resolved = %return os.path.resolve(self.allocator, cwd, self.argv[0]);
565 defer self.allocator.free(resolved);
566 break :x %return cstr.addNullByte(self.allocator, resolved);
567 } else x: {
568 break :x %return cstr.addNullByte(self.allocator, self.argv[0]);
563 const app_name = x: {
564 if (self.cwd) |cwd| {
565 const resolved = %return os.path.resolve(self.allocator, cwd, self.argv[0]);
566 defer self.allocator.free(resolved);
567 break :x %return cstr.addNullByte(self.allocator, resolved);
568 } else {
569 break :x %return cstr.addNullByte(self.allocator, self.argv[0]);
570 }
569571 };
570572 defer self.allocator.free(app_name);
571573
std/os/darwin.zig+2-2
......@@ -117,11 +117,11 @@ pub fn close(fd: i32) -> usize {
117117}
118118
119119pub fn abort() -> noreturn {
120 return c.abort();
120 c.abort();
121121}
122122
123123pub fn exit(code: i32) -> noreturn {
124 return c.exit(code);
124 c.exit(code);
125125}
126126
127127pub fn isatty(fd: i32) -> bool {
std/os/windows/util.zig+3-3
......@@ -16,11 +16,11 @@ pub fn windowsWaitSingle(handle: windows.HANDLE, milliseconds: windows.DWORD) ->
1616 windows.WAIT_ABANDONED => error.WaitAbandoned,
1717 windows.WAIT_OBJECT_0 => {},
1818 windows.WAIT_TIMEOUT => error.WaitTimeOut,
19 windows.WAIT_FAILED => {
19 windows.WAIT_FAILED => x: {
2020 const err = windows.GetLastError();
21 switch (err) {
21 break :x switch (err) {
2222 else => os.unexpectedErrorWindows(err),
23 }
23 };
2424 },
2525 else => error.Unexpected,
2626 };