summaryrefslogtreecommitdiffstats
path: root/libdimension/error.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-10-29 23:19:31 -0400
committerTavian Barnes <tavianator@gmail.com>2009-10-29 23:19:31 -0400
commit29963e449e8e4c8a3b4eeda9ef9a57083184697d (patch)
treefc5c72d643b661102efa41ea32942cfa779a43c6 /libdimension/error.c
parent7c414dea9bb4c65d6a0e4426a0d6ac172500f4b6 (diff)
downloaddimension-29963e449e8e4c8a3b4eeda9ef9a57083184697d.tar.xz
Make sure we die on critical dmnsn_error()'s.
Diffstat (limited to 'libdimension/error.c')
-rw-r--r--libdimension/error.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libdimension/error.c b/libdimension/error.c
index 57880f9..da7b8bd 100644
--- a/libdimension/error.c
+++ b/libdimension/error.c
@@ -39,6 +39,7 @@ dmnsn_report_error(dmnsn_severity severity, const char *func, unsigned int line,
/* An error more severe than our resilience happened, bail out */
fprintf(stderr, "Dimension ERROR: %s, line %u: %s\n", func, line, str);
(*dmnsn_fatal)();
+ exit(EXIT_FAILURE); /* Failsafe in case *dmnsn_fatal doesn't exit */
} else {
/* A trivial error happened, warn and continue */
fprintf(stderr, "Dimension WARNING: %s, line %u: %s\n", func, line, str);
@@ -76,6 +77,7 @@ dmnsn_set_resilience(dmnsn_severity resilience)
fprintf(stderr, "Dimension ERROR: %s, line %u: %s\n", DMNSN_FUNC, __LINE__,
"Resilience has wrong value.");
(*dmnsn_fatal)();
+ exit(EXIT_FAILURE);
}
if (pthread_mutex_lock(&dmnsn_resilience_mutex) != 0) {