Skip to content

Commit

Permalink
v2: sync initial value for exit code with v1
Browse files Browse the repository at this point in the history
The initial value for the exit_code (0x7f) in v2 doesn't work with musl libc.
Here WIFSIGNALED(0x7f) expands to a non-zero value:

http://git.musl-libc.org/cgit/musl/tree/include/sys/wait.h#n54
  • Loading branch information
ceggers-arri authored and klemens-morgenstern committed Mar 31, 2024
1 parent c6951ff commit 406cd3e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/boost/process/v2/exit_code.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ typedef int native_exit_code_type;

namespace detail
{
constexpr native_exit_code_type still_active = 0x7f;
constexpr native_exit_code_type still_active = 0x17f;
static_assert(WIFSTOPPED(still_active), "Expected still_active to indicate WIFSTOPPED");
static_assert(!WIFEXITED(still_active), "Expected still_active to not indicate WIFEXITED");
static_assert(!WIFSIGNALED(still_active), "Expected still_active to not indicate WIFSIGNALED");
static_assert(!WIFCONTINUED(still_active), "Expected still_active to not indicate WIFCONTINUED");
}

inline bool process_is_running(int code)
Expand Down

0 comments on commit 406cd3e

Please sign in to comment.