From c3ca46e619744ccd6c597417cc8e373149608909 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 3 Aug 2017 12:33:40 +0100 Subject: ash: fixes to wait status Replace W* macros with versions from GNU C library. Change wait status values to match. --- include/mingw.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/mingw.h') diff --git a/include/mingw.h b/include/mingw.h index 5f1074160..574a77e7c 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -184,10 +184,10 @@ int winansi_get_terminal_width_height(struct winsize *win); /* * stdlib.h */ -#define WIFEXITED(x) ((unsigned)(x) < 259) /* STILL_ACTIVE */ -#define WEXITSTATUS(x) ((x) & 0xff) -#define WIFSIGNALED(x) ((unsigned)(x) > 259) #define WTERMSIG(x) ((x) & 0x7f) +#define WIFEXITED(x) (WTERMSIG(x) == 0) +#define WEXITSTATUS(x) (((x) & 0xff00) >> 8) +#define WIFSIGNALED(x) (((signed char) (((x) & 0x7f) + 1) >> 1) > 0) #define WCOREDUMP(x) 0 int mingw_system(const char *cmd); -- cgit v1.2.3-55-g6feb