From 59db781d7a08e3007d08b6632583ac9ced82e0df Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 25 Mar 2011 12:40:25 -0400 Subject: exit(EXIT_FAILURE) when mutexes fail in error.c. --- libdimension/error.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libdimension') diff --git a/libdimension/error.c b/libdimension/error.c index 018f582..098348b 100644 --- a/libdimension/error.c +++ b/libdimension/error.c @@ -97,12 +97,14 @@ dmnsn_get_fatal_error_fn(void) fprintf(stderr, "Dimension WARNING: %s, line %u: %s\n", DMNSN_FUNC, __LINE__, "Couldn't lock fatal error handler mutex."); + exit(EXIT_FAILURE); } fatal = dmnsn_fatal; if (pthread_mutex_unlock(&dmnsn_fatal_mutex) != 0) { fprintf(stderr, "Dimension WARNING: %s, line %u: %s\n", DMNSN_FUNC, __LINE__, "Couldn't unlock fatal error handler mutex."); + exit(EXIT_FAILURE); } return fatal; } @@ -114,12 +116,14 @@ dmnsn_set_fatal_error_fn(dmnsn_fatal_error_fn *fatal) fprintf(stderr, "Dimension WARNING: %s, line %u: %s\n", DMNSN_FUNC, __LINE__, "Couldn't lock fatal error handler mutex."); + exit(EXIT_FAILURE); } dmnsn_fatal = fatal; if (pthread_mutex_unlock(&dmnsn_fatal_mutex) != 0) { fprintf(stderr, "Dimension WARNING: %s, line %u: %s\n", DMNSN_FUNC, __LINE__, "Couldn't unlock fatal error handler mutex."); + exit(EXIT_FAILURE); } } -- cgit v1.2.3