diff options
| author | Garrett Squire <github@garrettsquire.com> | 2021-03-24 18:27:56 -0700 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-06-12 23:13:14 +0300 |
| commit | a6d72fea06364da26b4efacb188303c5bddf5da3 (patch) | |
| tree | 07dbec9fc4e1923a4c23f720913f6b3a2ff4d4c9 /lib/std/os/bits/linux.zig | |
| parent | ea4a25287eb65e639fd75d425f320663e6e8dca1 (diff) | |
| download | zig-a6d72fea06364da26b4efacb188303c5bddf5da3.tar.gz zig-a6d72fea06364da26b4efacb188303c5bddf5da3.zip | |
Make std.ChildProcess exit code u8 to match std.process.exit
This patch adjusts the exit code for a child process to be a u8. Since
the WEXITSTATUS macro returns the lower eight bits, it's safe to assume
that we can truncate the returned u32.
Diffstat (limited to 'lib/std/os/bits/linux.zig')
| -rw-r--r-- | lib/std/os/bits/linux.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/os/bits/linux.zig b/lib/std/os/bits/linux.zig index 8887e9d223..d4491da6d0 100644 --- a/lib/std/os/bits/linux.zig +++ b/lib/std/os/bits/linux.zig @@ -1043,8 +1043,8 @@ pub const TFD_CLOEXEC = O_CLOEXEC; pub const TFD_TIMER_ABSTIME = 1; pub const TFD_TIMER_CANCEL_ON_SET = (1 << 1); -pub fn WEXITSTATUS(s: u32) u32 { - return (s & 0xff00) >> 8; +pub fn WEXITSTATUS(s: u32) u8 { + return @intCast(u8, (s & 0xff00) >> 8); } pub fn WTERMSIG(s: u32) u32 { return s & 0x7f; |
