diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-03-25 12:40:25 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-03-25 12:41:30 -0400 |
commit | 59db781d7a08e3007d08b6632583ac9ced82e0df (patch) | |
tree | b26aa1c03d720d4a40fc32b84909fda0f0d03df0 /libdimension/error.c | |
parent | 57d39451220384f580be2dfc6265ca940f556b81 (diff) | |
download | dimension-59db781d7a08e3007d08b6632583ac9ced82e0df.tar.xz |
exit(EXIT_FAILURE) when mutexes fail in error.c.
Diffstat (limited to 'libdimension/error.c')
-rw-r--r-- | libdimension/error.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); } } |