Re: [Autogen-users] autogen always crashes on error
Brought to you by:
bkorb
|
From: Bruce K. <bru...@gm...> - 2017-08-11 23:54:49
|
With the latest incarnation, you can specify "no-abort" with either
--no-abort
on the command line, or
AUTOGEN_NO_ABORT=true
in the environment. The function "cleanup_and_abort()" handles
calls to abort() and those calls are now all guarded via:
diff --git a/agen5/autogen.c b/agen5/autogen.c
index 60703ec2..2140cdce 100644
--- a/agen5/autogen.c
+++ b/agen5/autogen.c
@@ -233,6 +233,9 @@ cleanup_and_abort(int sig)
if (processing_state == PROC_STATE_ABORTING) {
exit_cleanup(EXIT_PCLOSE_NOWAIT);
+
+ if (HAVE_OPT(NO_ABORT))
+ exit(AUTOGEN_EXIT_USAGE_ERROR);
abort();
}
@@ -282,6 +285,9 @@ cleanup_and_abort(int sig)
#endif
exit_cleanup(EXIT_PCLOSE_NOWAIT);
+
+ if (HAVE_OPT(NO_ABORT))
+ exit(AUTOGEN_EXIT_USAGE_ERROR);
abort();
}
@@ -484,6 +490,9 @@ ag_abend_at(char const * msg
if (msg[-1] != NL)
fputc(NL, stderr);
+ if (HAVE_OPT(NO_ABORT))
+ exit(AUTOGEN_EXIT_USAGE_ERROR);
+
#ifdef DEBUG_ENABLED
abort();
#else
|