summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-31 15:40:25 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-31 15:40:25 +0000
commit54bde22eb499f1f05f6e8a27408ecc5a2ac5eb8b (patch)
treead5c1bc6852add80a820315a164adcf12a851a36
parent952d58bcfb227af8fe1927f0e38f8b6016dff6b6 (diff)
only return 8 bits of status
-rw-r--r--sys/sys/wait.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/sys/wait.h b/sys/sys/wait.h
index 66bfa466946..182943e0c5c 100644
--- a/sys/sys/wait.h
+++ b/sys/sys/wait.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wait.h,v 1.8 2002/03/14 01:27:14 millert Exp $ */
+/* $OpenBSD: wait.h,v 1.9 2003/05/31 15:40:24 deraadt Exp $ */
/* $NetBSD: wait.h,v 1.11 1996/04/09 20:55:51 cgd Exp $ */
/*
@@ -58,11 +58,11 @@
#define _WSTATUS(x) (_W_INT(x) & 0177)
#define _WSTOPPED 0177 /* _WSTATUS if process is stopped */
#define WIFSTOPPED(x) (_WSTATUS(x) == _WSTOPPED)
-#define WSTOPSIG(x) (_W_INT(x) >> 8)
+#define WSTOPSIG(x) ((_W_INT(x) >> 8) & 0xff)
#define WIFSIGNALED(x) (_WSTATUS(x) != _WSTOPPED && _WSTATUS(x) != 0)
#define WTERMSIG(x) (_WSTATUS(x))
#define WIFEXITED(x) (_WSTATUS(x) == 0)
-#define WEXITSTATUS(x) (_W_INT(x) >> 8)
+#define WEXITSTATUS(x) ((_W_INT(x) >> 8) & 0xff)
#ifndef _POSIX_SOURCE
#define WCOREDUMP(x) (_W_INT(x) & WCOREFLAG)