From c838cdab3440d89ae499cc60826c8571e4aebfc0 Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Mon, 13 Nov 2017 17:13:06 +0100 Subject: [PATCH] fix(library/process): do not strip signal information from child exit status This should match the meaning of "$?" in bash: "3.7.5 Exit Status The exit status of an executed command is the value returned by the waitpid system call or equivalent function. Exit statuses fall between 0 and 255." Fixes #1868 --- src/library/process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/library/process.cpp b/src/library/process.cpp index fa56c744a4..8de0576f7b 100644 --- a/src/library/process.cpp +++ b/src/library/process.cpp @@ -324,7 +324,7 @@ struct unix_child : public child { unsigned wait() override { int status; waitpid(m_pid, &status, 0); - return static_cast(WEXITSTATUS(status)); + return static_cast(status); } };