From: Pavel Charvat Date: Tue, 14 Jan 2014 07:58:15 +0000 (+0100) Subject: LibUCW: Implemented UCW_DIE_BY_ABORT environment switch. X-Git-Tag: v5.99~36 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=82d6c472e0e742e3c5d2572855710b0a4a2e619b;p=libucw.git LibUCW: Implemented UCW_DIE_BY_ABORT environment switch. --- 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 }