mirror of
https://github.com/swaywm/sway.git
synced 2025-10-31 22:25:26 -04:00
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.
This commit is contained in:
parent
40b3215444
commit
5e253fdd9a
9 changed files with 24 additions and 20 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue