Commit ea805c5fe7

Andrew Kelley <superjoe30@gmail.com>
2017-12-22 08:33:39
fix darwin and windows from previous commit
1 parent d917815
Changed files (3)
std/os/windows/util.zig
@@ -16,11 +16,11 @@ pub fn windowsWaitSingle(handle: windows.HANDLE, milliseconds: windows.DWORD) ->
         windows.WAIT_ABANDONED => error.WaitAbandoned,
         windows.WAIT_OBJECT_0 => {},
         windows.WAIT_TIMEOUT => error.WaitTimeOut,
-        windows.WAIT_FAILED => {
+        windows.WAIT_FAILED => x: {
             const err = windows.GetLastError();
-            switch (err) {
+            break :x switch (err) {
                 else => os.unexpectedErrorWindows(err),
-            }
+            };
         },
         else => error.Unexpected,
     };
std/os/child_process.zig
@@ -560,12 +560,14 @@ pub const ChildProcess = struct {
 
         // the cwd set in ChildProcess is in effect when choosing the executable path
         // to match posix semantics
-        const app_name = if (self.cwd) |cwd| x: {
-            const resolved = %return os.path.resolve(self.allocator, cwd, self.argv[0]);
-            defer self.allocator.free(resolved);
-            break :x %return cstr.addNullByte(self.allocator, resolved);
-        } else x: {
-            break :x %return cstr.addNullByte(self.allocator, self.argv[0]);
+        const app_name = x: {
+            if (self.cwd) |cwd| {
+                const resolved = %return os.path.resolve(self.allocator, cwd, self.argv[0]);
+                defer self.allocator.free(resolved);
+                break :x %return cstr.addNullByte(self.allocator, resolved);
+            } else {
+                break :x %return cstr.addNullByte(self.allocator, self.argv[0]);
+            }
         };
         defer self.allocator.free(app_name);
 
std/os/darwin.zig
@@ -117,11 +117,11 @@ pub fn close(fd: i32) -> usize {
 }
 
 pub fn abort() -> noreturn {
-    return c.abort();
+    c.abort();
 }
 
 pub fn exit(code: i32) -> noreturn {
-    return c.exit(code);
+    c.exit(code);
 }
 
 pub fn isatty(fd: i32) -> bool {