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.
macos/v1.5.9
Emmanuele Bassi 7 years ago committed by Adam Jackson
parent 737b691870
commit 791b28c186
  1. 6
      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 (!*handle) {
if (exit_on_fail) { if (exit_on_fail) {
fprintf(stderr, "Couldn't open %s: %s\n", lib_name, dlerror()); fprintf(stderr, "Couldn't open %s: %s\n", lib_name, dlerror());
exit(1); abort();
} else { } else {
(void)dlerror(); (void)dlerror();
} }
@ -342,7 +342,7 @@ do_dlsym(void **handle, const char *name, bool exit_on_fail)
#endif #endif
if (!result && exit_on_fail) { if (!result && exit_on_fail) {
fprintf(stderr, "%s() not found: %s\n", name, error); fprintf(stderr, "%s() not found: %s\n", name, error);
exit(1); abort();
} }
return result; return result;
@ -412,7 +412,7 @@ epoxy_internal_gl_version(GLenum version_string, int error_version)
if (scanf_count != 2) { if (scanf_count != 2) {
fprintf(stderr, "Unable to interpret GL_VERSION string: %s\n", fprintf(stderr, "Unable to interpret GL_VERSION string: %s\n",
version); version);
exit(1); abort();
} }
if (minor >= 10) if (minor >= 10)

Loading…
Cancel
Save