summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/stdlib.h4
-rw-r--r--include/sys/wait.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 0bcc9f4f..548bbca6 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -88,8 +88,8 @@ size_t wcstombs (char *__restrict, const wchar_t *__restrict, size_t);
#define WTERMSIG(s) ((s) & 0x7f)
#define WSTOPSIG(s) WEXITSTATUS(s)
#define WIFEXITED(s) (!WTERMSIG(s))
-#define WIFSTOPPED(s) (((s) & 0xff) == 0x7f)
-#define WIFSIGNALED(s) (((signed char) (((s) & 0x7f) + 1) >> 1) > 0)
+#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
+#define WIFSIGNALED(s) (((s)&0xffff)-1 < 0xffu)
int posix_memalign (void **, size_t, size_t);
int setenv (const char *, const char *, int);
diff --git a/include/sys/wait.h b/include/sys/wait.h
index b6dfe01d..a7ad7cd1 100644
--- a/include/sys/wait.h
+++ b/include/sys/wait.h
@@ -45,8 +45,8 @@ pid_t wait4 (pid_t, int *, int, struct rusage *);
#define WSTOPSIG(s) WEXITSTATUS(s)
#define WCOREDUMP(s) ((s) & 0x80)
#define WIFEXITED(s) (!WTERMSIG(s))
-#define WIFSTOPPED(s) (((s) & 0xff) == 0x7f)
-#define WIFSIGNALED(s) (((signed char) (((s) & 0x7f) + 1) >> 1) > 0)
+#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
+#define WIFSIGNALED(s) (((s)&0xffff)-1 < 0xffu)
#define WIFCONTINUED(s) ((s) == 0xffff)
#ifdef __cplusplus