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. --- swaygrab/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'swaygrab') diff --git a/swaygrab/main.c b/swaygrab/main.c index 82d623e7..6ba8fb3e 100644 --- a/swaygrab/main.c +++ b/swaygrab/main.c @@ -11,8 +11,8 @@ #include "ipc-client.h" #include "util.h" -void sway_terminate(void) { - exit(EXIT_FAILURE); +void sway_terminate(int exit_code) { + exit(exit_code); } void grab_and_apply_magick(const char *file, const char *output, -- cgit v1.2.3-70-g09d2