From 5e253fdd9ac5c8733203eec9870aa0ca2cd238fd Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Fri, 26 Feb 2016 09:08:05 +0100 Subject: Correctly exit sway on errors. Calling `exit` in sway_terminate prevents sway from correctly shutting down (freeing data, cleanly terminating the ipc server, etc.). A better way is to exit straight away if the failure occurs before `wlc_run` and use sway_abort as usual if it occur when wlc is running. --- swaybg/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'swaybg') diff --git a/swaybg/main.c b/swaybg/main.c index b936be2b..fbd0d16b 100644 --- a/swaybg/main.c +++ b/swaybg/main.c @@ -21,7 +21,7 @@ enum scaling_mode { SCALING_MODE_TILE, }; -void sway_terminate(void) { +void sway_terminate(int exit_code) { int i; for (i = 0; i < surfaces->length; ++i) { struct window *window = surfaces->items[i]; @@ -29,7 +29,7 @@ void sway_terminate(void) { } list_free(surfaces); registry_teardown(registry); - exit(EXIT_FAILURE); + exit(exit_code); } int main(int argc, const char **argv) { -- cgit v1.2.3-54-g00ecf