Skip to content

Commit ea805c5

Browse files
committedDec 22, 2017
fix darwin and windows from previous commit
·
0.15.20.2.0
1 parent d917815 commit ea805c5

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed
 

‎std/os/child_process.zig‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ pub fn close(fd: i32) -> usize {
117117
}
118118

119119
pub fn abort() -> noreturn {
120-
return c.abort();
120+
c.abort();
121121
}
122122

123123
pub fn exit(code: i32) -> noreturn {
124-
return c.exit(code);
124+
c.exit(code);
125125
}
126126

127127
pub fn isatty(fd: i32) -> bool {

‎std/os/windows/util.zig‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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
};

0 commit comments

Comments
 (0)
Please sign in to comment.