From 8f9ab92e25808922af0070f2c778ea2a2aa108eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 19 Jan 2011 20:32:02 +0000 Subject: [PATCH] distinguish between failure exit due to dmake failure vs signal aborted --- dmake/dmake.h | 3 ++- dmake/quit.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dmake/dmake.h b/dmake/dmake.h index 457031fdb50d..c3003a3db911 100644 --- a/dmake/dmake.h +++ b/dmake/dmake.h @@ -28,7 +28,8 @@ #define MAX_INC_DEPTH 10 /* max of ten nested include files */ #define MAX_COND_DEPTH 20 /* max nesting level of conditionals */ -#define ERROR_EXIT_VALUE 255 /* return code of aborted make */ +#define ERROR_ABORT_VALUE 254 /* return code of aborted make */ +#define ERROR_EXIT_VALUE 255 /* return code of failed make */ #define CONTINUATION_CHAR '\\' /* line continuation \ */ #define DEF_ESCAPE_CHAR '\\' /* escape char for used chars */ #define ESCAPE_CHAR *Escape_char diff --git a/dmake/quit.c b/dmake/quit.c index 54043093de24..68ade197fd24 100644 --- a/dmake/quit.c +++ b/dmake/quit.c @@ -37,6 +37,8 @@ Quit( sig )/* ======== Error or quit */ int sig; { + int ret = ERROR_ABORT_VALUE; + if( sig == SIGINT ) fprintf(stderr, "Caught SIGINT. Trying to quit ...\n"); else @@ -48,7 +50,7 @@ int sig; #endif if( sig == 0 ) /* Don't be verbose during regular program termination. */ - ; + ret = ERROR_EXIT_VALUE; else fprintf(stderr, "Caught signal %d. Trying to quit ...\n", sig); @@ -78,7 +80,7 @@ int sig; if( _quitting == 0 ) _handle_quit( ".ERROR" ); Set_dir( Makedir ); /* No Error message if we can't do it */ - Epilog( ERROR_EXIT_VALUE ); + Epilog( ret ); }