From f9f36fec189a31307705bca36dd14389266a7840 Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Sun, 23 Jan 2022 16:44:36 +0100 Subject: [PATCH] sysdeps/squiid: Fix sys/wait.h header macros Signed-off-by: Christoph Heiss --- abis/squiid/wait.h | 8 ++++---- sysdeps/squiid/include/squiid/process.h | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/abis/squiid/wait.h b/abis/squiid/wait.h index 72b86bc1..240dcc99 100644 --- a/abis/squiid/wait.h +++ b/abis/squiid/wait.h @@ -11,9 +11,9 @@ #define WSTOPSIG(x) (((x) & 0x0000ff00) >> 8) #define WTERMSIG(x) (((x) & 0x00ff0000) >> 16) -#define WIFCONTINUED(x) ((x) & 0x00100000) -#define WIFEXITED(x) ((x) & 0x00200000) -#define WIFSIGNALED(x) ((x) & 0x00400000) -#define WIFSTOPPED(x) ((x) & 0x00800000) +#define WIFCONTINUED(x) (((x) & 0x00100000) == 0x00100000) +#define WIFEXITED(x) (((x) & 0x00200000) == 0x00200000) +#define WIFSIGNALED(x) (((x) & 0x00400000) == 0x00400000) +#define WIFSTOPPED(x) (((x) & 0x00800000) == 0x00800000) #endif //_ABIBITS_WAIT_H diff --git a/sysdeps/squiid/include/squiid/process.h b/sysdeps/squiid/include/squiid/process.h index 56264859..31ee7dc8 100644 --- a/sysdeps/squiid/include/squiid/process.h +++ b/sysdeps/squiid/include/squiid/process.h @@ -61,9 +61,14 @@ #define SQ_WAIT_STAT_EXITED 0x200000 #define SQ_WAIT_STAT_SIGNALED 0x400000 #define SQ_WAIT_STAT_STOPPED 0x800000 -#define SQ_WAIT_STAT_EXITCODE_MASK 0xff -#define SQ_WAIT_STAT_STOPSIG_MASK 0xff00 -#define SQ_WAIT_STAT_TERMSIG_MASK 0xff0000 + +#define __SQ_WAIT_STAT_EXITCODE_SHIFT 0 +#define __SQ_WAIT_STAT_STOPSIG_SHIFT 8 +#define __SQ_WAIT_STAT_TERMSIG_SHIFT 16 + +#define SQ_WAIT_STAT_EXITCODE_MASK (0xff << __SQ_WAIT_STAT_EXITCODE_SHIFT) +#define SQ_WAIT_STAT_STOPSIG_MASK (0xff << __SQ_WAIT_STAT_STOPSIG_SHIFT) +#define SQ_WAIT_STAT_TERMSIG_MASK (0xff << __SQ_WAIT_STAT_TERMSIG_SHIFT) #ifndef __ASSEMBLER__