Weston has a SIGSEGV handler that attempts to shut everything down
cleanly. If it actually succeeds in that, the process exit status will
indicate success, when the process just segfaulted.
Fix that by setting the return value to failure in the SEGV handler.
v2: use a local instead of a global variable
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
int main(int argc, char *argv[])
{
+ int ret = EXIT_SUCCESS;
struct wl_display *display;
struct weston_compositor *ec;
struct wl_event_source *signals[4];
weston_compositor_wake(ec);
if (setjmp(segv_jmp_buf) == 0)
wl_display_run(display);
+ else
+ ret = EXIT_FAILURE;
/* prevent further rendering while shutting down */
ec->state = WESTON_COMPOSITOR_SLEEPING;
ec->destroy(ec);
wl_display_destroy(display);
- return 0;
+ return ret;
}