From 791b28c186882eb8d56f1002acda1dbb4ac00de3 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 14 May 2018 12:49:21 +0100 Subject: [PATCH] Use abort() instead of exit(1) We want to consistently handle exceptions for the internal state checks; calling `exit()` does not allow us to attach a debugger and get a proper trace. --- src/dispatch_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index dedf664..e2bb186 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -315,7 +315,7 @@ get_dlopen_handle(void **handle, const char *lib_name, bool exit_on_fail, bool l if (!*handle) { if (exit_on_fail) { fprintf(stderr, "Couldn't open %s: %s\n", lib_name, dlerror()); - exit(1); + abort(); } else { (void)dlerror(); } @@ -342,7 +342,7 @@ do_dlsym(void **handle, const char *name, bool exit_on_fail) #endif if (!result && exit_on_fail) { fprintf(stderr, "%s() not found: %s\n", name, error); - exit(1); + abort(); } return result; @@ -412,7 +412,7 @@ epoxy_internal_gl_version(GLenum version_string, int error_version) if (scanf_count != 2) { fprintf(stderr, "Unable to interpret GL_VERSION string: %s\n", version); - exit(1); + abort(); } if (minor >= 10)