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
f62e05982f
commit
381df20e24
4
main.c
4
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;
|
||||
|
Loading…
Reference in New Issue
Block a user