mirror of
https://github.com/swaywm/sway.git
synced 2026-04-25 06:46:24 -04:00
Log exec failures
This can happen when the swaybar or its status command isn't found. Instead of silently doing nothing, log the error.
This commit is contained in:
parent
30c28ff8f7
commit
c2c15b5625
2 changed files with 4 additions and 0 deletions
|
|
@ -238,6 +238,8 @@ static void invoke_swaybar(struct bar_config *bar) {
|
||||||
bar->swaybar_command ? bar->swaybar_command : "swaybar",
|
bar->swaybar_command ? bar->swaybar_command : "swaybar",
|
||||||
"-b", bar->id, NULL};
|
"-b", bar->id, NULL};
|
||||||
execvp(cmd[0], cmd);
|
execvp(cmd[0], cmd);
|
||||||
|
|
||||||
|
sway_log_errno(SWAY_ERROR, "Failed to start swaybar");
|
||||||
_exit(EXIT_FAILURE);
|
_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
_exit(EXIT_SUCCESS);
|
_exit(EXIT_SUCCESS);
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,8 @@ struct status_line *status_line_init(char *cmd) {
|
||||||
|
|
||||||
char *const _cmd[] = { "sh", "-c", cmd, NULL, };
|
char *const _cmd[] = { "sh", "-c", cmd, NULL, };
|
||||||
execvp(_cmd[0], _cmd);
|
execvp(_cmd[0], _cmd);
|
||||||
|
|
||||||
|
sway_log(SWAY_ERROR, "Failed to start status command");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue