diff options
author | Ian Lynagh <igloo@earth.li> | 2010-10-28 13:48:54 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-10-28 13:48:54 +0000 |
commit | 723da2ed96068632ede8d1e8514dd02bbe1336ea (patch) | |
tree | 834f53b5f30de23b414970a9a3c4e0eef7801e2a /rts | |
parent | fb9d21af24d076b12abb9e22251aa327f82e8ea8 (diff) | |
download | haskell-723da2ed96068632ede8d1e8514dd02bbe1336ea.tar.gz |
Replace some exit(n) calls with stg_exit(n); fixes trac #4445
Also changed exitcode of -1 to 1 in hpc.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/Hpc.c | 4 | ||||
-rw-r--r-- | rts/Linker.c | 2 | ||||
-rw-r--r-- | rts/RtsFlags.c | 2 | ||||
-rw-r--r-- | rts/win32/seh_excn.h | 8 |
4 files changed, 8 insertions, 8 deletions
@@ -51,7 +51,7 @@ failure(char *msg) { } else { fprintf(stderr,"(perhaps remove .tix file?)\n"); } - exit(-1); + stg_exit(1); } static int init_open(FILE *file) { @@ -235,7 +235,7 @@ hs_hpc_module(char *modName, fprintf(stderr,"in module '%s'\n",tmpModule->modName); failure("module mismatch with .tix/.mix file hash number"); fprintf(stderr,"(perhaps remove %s ?)\n",tixFilename); - exit(-1); + stg_exit(1); } for(i=0;i < modCount;i++) { diff --git a/rts/Linker.c b/rts/Linker.c index 4b984dac2d..1614a1a78f 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -1109,7 +1109,7 @@ static void ghciInsertStrHashTable ( char* obj_name, (char*)key, obj_name ); - exit(1); + stg_exit(1); } /* ----------------------------------------------------------------------------- * initialize the object linker diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 2e8ee9e9c8..c11cc3e925 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -554,7 +554,7 @@ error = rtsTrue; else if (strequal("info", &rts_argv[arg][2])) { printRtsInfo(); - exit(0); + stg_exit(0); } else { errorBelch("unknown RTS option: %s",rts_argv[arg]); diff --git a/rts/win32/seh_excn.h b/rts/win32/seh_excn.h index 7d17465cd1..8829e840b7 100644 --- a/rts/win32/seh_excn.h +++ b/rts/win32/seh_excn.h @@ -25,11 +25,11 @@ * * seh_excn provides two macros, BEGIN_CATCH and END_CATCH, which * will catch such exceptions in the code they bracket and die by - * printing a message and calling exit(1). + * printing a message and calling stg_exit(1). */ -#define ON_DIV_ZERO fprintf(stdout,"divide by zero\n"); fflush(stdout);exit(1) -#define ON_STACK_OVERFLOW fprintf(stdout,"C stack overflow in generated code\n"); fflush(stdout); exit(1) -#define ON_SIGSEGV fprintf(stdout,"Segmentation fault/access violation in generated code\n"); fflush(stdout); exit(1) +#define ON_DIV_ZERO fprintf(stdout,"divide by zero\n"); fflush(stdout);stg_exit(1) +#define ON_STACK_OVERFLOW fprintf(stdout,"C stack overflow in generated code\n"); fflush(stdout); stg_exit(1) +#define ON_SIGSEGV fprintf(stdout,"Segmentation fault/access violation in generated code\n"); fflush(stdout); stg_exit(1) #if defined(__MINGW32__) extern jmp_buf seh_unwind_to; |