From: Rich Felker Date: Sat, 19 Feb 2011 07:23:29 +0000 (-0500) Subject: add missing WIFCONTINUED macro and improve WIFSIGNALED X-Git-Tag: v0.7.0~95 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f3ef7a61245c5ace26ca13bccf14a28876ea7bfc;p=oweals%2Fmusl.git add missing WIFCONTINUED macro and improve WIFSIGNALED --- diff --git a/arch/i386/bits/wexitstatus.h b/arch/i386/bits/wexitstatus.h index 34a80238..591d401a 100644 --- a/arch/i386/bits/wexitstatus.h +++ b/arch/i386/bits/wexitstatus.h @@ -5,5 +5,6 @@ #define WCOREDUMP(s) ((s) & 0x80) #define WIFEXITED(s) (!WTERMSIG(s)) #define WIFSTOPPED(s) (((s) & 0xff) == 0x7f) -#define WIFSIGNALED(s) (!WIFSTOPPED(s) && !WIFEXITED(s)) +#define WIFSIGNALED(s) (((signed char) (((s) & 0x7f) + 1) >> 1) > 0) +#define WIFCONTINUED(s) ((s) == 0xffff) #endif diff --git a/arch/x86_64/bits/wexitstatus.h b/arch/x86_64/bits/wexitstatus.h index 34a80238..591d401a 100644 --- a/arch/x86_64/bits/wexitstatus.h +++ b/arch/x86_64/bits/wexitstatus.h @@ -5,5 +5,6 @@ #define WCOREDUMP(s) ((s) & 0x80) #define WIFEXITED(s) (!WTERMSIG(s)) #define WIFSTOPPED(s) (((s) & 0xff) == 0x7f) -#define WIFSIGNALED(s) (!WIFSTOPPED(s) && !WIFEXITED(s)) +#define WIFSIGNALED(s) (((signed char) (((s) & 0x7f) + 1) >> 1) > 0) +#define WIFCONTINUED(s) ((s) == 0xffff) #endif