diff options
author | Pekka Paalanen <ppaalanen@gmail.com> | 2012-06-08 17:27:28 +0300 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-06-08 12:52:18 -0400 |
commit | 3ab7269a9b6233b972b5288d35c912cd4c722235 (patch) | |
tree | 71af60128f65dddafeada9a3bb96ae20439dcad5 | |
parent | 1e51a87f13b24159cafb22f3441f1560ce5675d3 (diff) |
compositor: return failure even if SEGV handler works v2
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>
-rw-r--r-- | src/compositor.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compositor.c b/src/compositor.c index ac39fe9..3b1ca1e 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -3090,6 +3090,7 @@ static const char xdg_error_message[] = int main(int argc, char *argv[]) { + int ret = EXIT_SUCCESS; struct wl_display *display; struct weston_compositor *ec; struct wl_event_source *signals[4]; @@ -3217,6 +3218,8 @@ int main(int argc, char *argv[]) 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; @@ -3234,5 +3237,5 @@ int main(int argc, char *argv[]) ec->destroy(ec); wl_display_destroy(display); - return 0; + return ret; } |