aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMosder <git@mosder.eu>2026-10-06 17:56:55 +0200
committerMosder <git@mosder.eu>2026-10-06 17:56:55 +0200
commit81330972640629b905fbc3d10ffc3e53361479b5 (patch)
tree65270f3da3b196e11d3402a04d2b979644f1e2a7
parent4513d3c2733e63659320a0b4e23af9bdb72440b6 (diff)
changed status exit code getting to use WEXITSTATUS instead of bit shifting
-rw-r--r--src/tester.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tester.c b/src/tester.c
index 70e0d24..becc659 100644
--- a/src/tester.c
+++ b/src/tester.c
@@ -122,13 +122,18 @@ void mos_test_assert_exit_fn(MosTestFn function, int code, const char *name) {
int status;
waitpid(pid, &status, 0);
- int exit_code = status >> 8;
uint8_t exited = 1;
close(fd[1]);
read(fd[0], &exited, sizeof(uint8_t));
close(fd[0]);
+ int exit_code = 0;
+ if (WIFEXITED(status))
+ exit_code = WEXITSTATUS(status);
+ else
+ exited = 0;
+
if (!exited) {
failed = 1;
print_color(RED, "ASSERT FAILED: ");