From 82d6c472e0e742e3c5d2572855710b0a4a2e619b Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Tue, 14 Jan 2014 08:58:15 +0100 Subject: [PATCH] LibUCW: Implemented UCW_DIE_BY_ABORT environment switch. --- ucw/default.cfg | 4 ++++ ucw/log.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ucw/default.cfg b/ucw/default.cfg index 59fdde72..538d1c60 100644 --- a/ucw/default.cfg +++ b/ucw/default.cfg @@ -11,6 +11,10 @@ Set("UCW_ABI_SUFFIX" => "-" . Get("UCW_VERSION")); # Compile everything with debug information and ASSERT's UnSet("CONFIG_DEBUG"); +# Environment variable with a switch to abort() on die(). +# Any non-empty value of the variable turns this feature on. +Set("CONFIG_UCW_ENV_VAR_DIE_BY_ABORT" => "UCW_DIE_BY_ABORT"); + # Enable aggressive optimizations depending on exact CPU type (don't use for portable packages) UnSet("CONFIG_EXACT_CPU"); diff --git a/ucw/log.c b/ucw/log.c index cf5d115a..20c6d63a 100644 --- a/ucw/log.c +++ b/ucw/log.c @@ -337,6 +337,9 @@ do_die(void) #ifdef DEBUG_DIE_BY_ABORT abort(); #else + const char *env = getenv("CONFIG_UCW_ENV_VAR_DIE_BY_ABORT"); + if (env && *env) + abort(); exit(1); #endif } -- 2.39.2