summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorHartmut Becker <becker.ismaning@freenet.de>2014-08-24 22:06:15 +0200
committerPaul Smith <psmith@gnu.org>2014-09-07 17:41:59 -0400
commit8de07f3e4a67fa1c9bd5293d183090ad08b7be6f (patch)
tree2214e65558248378dad06d192b14bbd051e38367 /job.c
parentf970315766906ed789656d87720328b5513e5942 (diff)
downloadgunmake-8de07f3e4a67fa1c9bd5293d183090ad08b7be6f.tar.gz
Enhance/fix VMS exit code handling.
* commands.c, function.c, hash.c, job.c, main.c, output.c: use MAKE exit codes. * makeint.h: encode make exit codes so that they are VMS compatible. * job.c: check child exit code for VMS style exit codes. * vmsjobs.c: save and return VMS style exit code.
Diffstat (limited to 'job.c')
-rw-r--r--job.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/job.c b/job.c
index b3eab13..c52a03a 100644
--- a/job.c
+++ b/job.c
@@ -510,9 +510,14 @@ child_error (struct child *child,
OUTPUT_UNSET ();
return;
}
-
- error (NILF, l + INTSTR_LENGTH,
- _("%s[%s] Error 0x%x%s"), pre, f->name, exit_code, post);
+ /* Check for a Posix compatible VMS style exit code:
+ decode and print the Posix exit code */
+ if ((exit_code & 0x35a000) == 0x35a000)
+ error(NILF, l + INTSTR_LENGTH, _("%s[%s] Error %d%s"), pre, f->name,
+ ((exit_code & 0x7f8) >> 3), post);
+ else
+ error(NILF, l + INTSTR_LENGTH, _("%s[%s] Error 0x%x%s"), pre, f->name,
+ exit_code, post);
#else
if (exit_sig == 0)
error (NILF, l + INTSTR_LENGTH,
@@ -982,7 +987,7 @@ reap_children (int block, int err)
if (!err && child_failed && !dontcare && !keep_going_flag &&
/* fatal_error_signal will die with the right signal. */
!handling_fatal_signal)
- die (2);
+ die (MAKE_FAILURE);
/* Only block for one child. */
block = 0;