summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>1994-10-04 20:53:02 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>1994-10-04 20:53:02 +0000
commitb7826aaee52674cab554325a53956b377149c325 (patch)
tree8a014280d417c4ddd255ddba5eab01de2180301a /gcc/gcc.c
parent2cf8495e2e4d60638c76ce538780ff42761d6c2c (diff)
downloadgcc-b7826aaee52674cab554325a53956b377149c325.tar.gz
If the POSIX.1 wait macros are defined, use them.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8213 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 2f9362112b7..e1e870e6423 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -60,6 +60,19 @@ compilation is specified by a string called a "spec". */
#define X_OK 1
#endif
+#ifndef WIFSIGNALED
+#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
+#endif
+#ifndef WTERMSIG
+#define WTERMSIG(S) ((S) & 0x7f)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(S) (((S) & 0xff) == 0)
+#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
+#endif
+
/* Add prototype support. */
#ifndef PROTO
#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
@@ -2262,13 +2275,15 @@ execute ()
if (commands[j].pid == pid)
prog = commands[j].prog;
- if ((status & 0x7F) != 0)
+ if (WIFSIGNALED (status))
{
fatal ("Internal compiler error: program %s got fatal signal %d",
- prog, (status & 0x7F));
+ prog, WTERMSIG (status));
signal_count++;
+ ret_code = -1;
}
- if (((status & 0xFF00) >> 8) >= MIN_FATAL_STATUS)
+ else if (WIFEXITED (status)
+ && WEXITSTATUS (status) >= MIN_FATAL_STATUS)
ret_code = -1;
}
}