diff options
| author | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-02-26 09:08:05 +0100 |
|---|---|---|
| committer | Mikkel Oscar Lyderik <mikkeloscar@gmail.com> | 2016-02-26 09:42:21 +0100 |
| commit | 381df20e241a2bffd03bfd0442f158deea93cefb (patch) | |
| tree | 464f6650cfb4edf4b5dcada00f063473734ee0fa /main.c | |
| parent | f62e05982f2d37f14117eea9c921cb65a72faff4 (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 'main.c')
| -rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -24,7 +24,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]; @@ -32,7 +32,7 @@ void sway_terminate(void) { } list_free(surfaces); registry_teardown(registry); - exit(EXIT_FAILURE); + exit(exit_code); } char *password; |
