diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-10-22 18:20:09 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-10-22 18:20:09 +0200 |
| commit | e179690a9c85de9bf53ff3165c9796dcfda3ce3a (patch) | |
| tree | 550a4f8d869683c8fc8429844ed912af4a1c34a5 | |
| parent | 3e4743e9a24c7d4ae02b67799fcee44f727096e1 (diff) | |
| download | river-e179690a9c85de9bf53ff3165c9796dcfda3ce3a.tar.gz river-e179690a9c85de9bf53ff3165c9796dcfda3ce3a.tar.xz | |
code: update os.waitpid usage for breaking change
| -rw-r--r-- | river/Output.zig | 4 | ||||
| -rw-r--r-- | river/command/spawn.zig | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/river/Output.zig b/river/Output.zig index 21ecfb2..d19c8ec 100644 --- a/river/Output.zig +++ b/river/Output.zig @@ -242,8 +242,8 @@ fn layoutExternal(self: *Self, visible_count: u32) !void { defer stdout.close(); // TODO abort after a timeout - const status = std.os.waitpid(pid, 0); - if (!std.os.WIFEXITED(status) or std.os.WEXITSTATUS(status) != 0) + const ret = std.os.waitpid(pid, 0); + if (!std.os.WIFEXITED(ret.status) or std.os.WEXITSTATUS(ret.status) != 0) return LayoutError.BadExitCode; const buffer = try stdout.inStream().readAllAlloc(&arena.allocator, 1024); diff --git a/river/command/spawn.zig b/river/command/spawn.zig index 8e1bdfe..101e377 100644 --- a/river/command/spawn.zig +++ b/river/command/spawn.zig @@ -55,9 +55,9 @@ pub fn spawn( } // Wait the intermediate child. - const status = std.os.waitpid(pid, 0); - if (!std.os.WIFEXITED(status) or - (std.os.WIFEXITED(status) and std.os.WEXITSTATUS(status) != 0)) + const ret = std.os.waitpid(pid, 0); + if (!std.os.WIFEXITED(ret.status) or + (std.os.WIFEXITED(ret.status) and std.os.WEXITSTATUS(ret.status) != 0)) { out.* = try std.fmt.allocPrint(allocator, "fork/execve failed", .{}); return Error.Other; |
