aboutsummaryrefslogtreecommitdiff
path: root/swaymsg
diff options
context:
space:
mode:
authorMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-02-26 09:08:05 +0100
committerMikkel Oscar Lyderik <mikkeloscar@gmail.com>2016-02-26 09:42:21 +0100
commit5e253fdd9ac5c8733203eec9870aa0ca2cd238fd (patch)
tree3bfaae22500ddfc326dfd4fa4b81bbab285a4c2f /swaymsg
parent40b3215444ed48d2ed9bbaa00f20f266f5318f5a (diff)
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.
Diffstat (limited to 'swaymsg')
-rw-r--r--swaymsg/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c
index 22572b6f..88a8fab0 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -11,8 +11,8 @@
#include "readline.h"
#include "log.h"
-void sway_terminate(void) {
- exit(EXIT_FAILURE);
+void sway_terminate(int exit_code) {
+ exit(exit_code);
}
int main(int argc, char **argv) {