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:
Simon Ser 2021-09-12 09:05:46 +02:00
parent 30c28ff8f7
commit c2c15b5625
2 changed files with 4 additions and 0 deletions

View file

@ -238,6 +238,8 @@ static void invoke_swaybar(struct bar_config *bar) {
bar->swaybar_command ? bar->swaybar_command : "swaybar",
"-b", bar->id, NULL};
execvp(cmd[0], cmd);
sway_log_errno(SWAY_ERROR, "Failed to start swaybar");
_exit(EXIT_FAILURE);
}
_exit(EXIT_SUCCESS);

View file

@ -168,6 +168,8 @@ struct status_line *status_line_init(char *cmd) {
char *const _cmd[] = { "sh", "-c", cmd, NULL, };
execvp(_cmd[0], _cmd);
sway_log(SWAY_ERROR, "Failed to start status command");
exit(1);
}