Skip to content

Commit

Permalink
Use abort() instead of exit(1)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ebassi authored and nwnk committed May 17, 2018
1 parent 737b691 commit 791b28c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dispatch_common.c
Expand Up @@ -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();
}
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 791b28c

Please sign in to comment.