diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2018-05-14 12:49:21 +0100 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2018-05-17 12:02:42 -0400 |
commit | 791b28c186882eb8d56f1002acda1dbb4ac00de3 (patch) | |
tree | ba275db6ea7da563e4aff77796736e41990f2a22 | |
parent | 737b6918703c1d0be1e3d5272f7d06211cdb2b87 (diff) | |
download | libepoxy-791b28c186882eb8d56f1002acda1dbb4ac00de3.tar.gz |
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.
-rw-r--r-- | src/dispatch_common.c | 6 |
1 files 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) |