]> mj.ucw.cz Git - libucw.git/commitdiff
LibUCW: Implemented UCW_DIE_BY_ABORT environment switch.
authorPavel Charvat <pchar@ucw.cz>
Tue, 14 Jan 2014 07:58:15 +0000 (08:58 +0100)
committerPavel Charvat <pchar@ucw.cz>
Tue, 14 Jan 2014 07:58:15 +0000 (08:58 +0100)
ucw/default.cfg
ucw/log.c

index 59fdde729beb74d9d408b59c435c54a8fe736ef5..538d1c60cb5889b0a3614b359dcc2bd430e78768 100644 (file)
@@ -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");
 
index cf5d115ad78ee9aae4dd25e9f370fb3e0f5335e6..20c6d63a08738bd17a9535bc9e43cbaee53d80d2 100644 (file)
--- 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
 }