diff options
author | Mikkel Oscar Lyderik <[email protected]> | 2016-02-26 09:08:05 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <[email protected]> | 2016-02-26 09:42:21 +0100 |
commit | 5e253fdd9ac5c8733203eec9870aa0ca2cd238fd (patch) | |
tree | 3bfaae22500ddfc326dfd4fa4b81bbab285a4c2f /swaylock/main.c | |
parent | 40b3215444ed48d2ed9bbaa00f20f266f5318f5a (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 'swaylock/main.c')
-rw-r--r-- | swaylock/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/swaylock/main.c b/swaylock/main.c index 9b14086d..b20883af 100644 --- a/swaylock/main.c +++ b/swaylock/main.c @@ -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; |