Skip to content

Commit 0e99e0a

Browse files
authored
Merge pull request #4213 from krobelus/bsd-wexitstatus
Apply modulo 256 to BSD WEXITSTATUS
2 parents ca7695a + f9cde2f commit 0e99e0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/unix/bsd/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ safe_f! {
639639
}
640640

641641
pub {const} fn WEXITSTATUS(status: c_int) -> c_int {
642-
status >> 8
642+
(status >> 8) & 0x00ff
643643
}
644644

645645
pub {const} fn WCOREDUMP(status: c_int) -> bool {

0 commit comments

Comments
 (0)