Skip to content

Commit

Permalink
commands/exec_always: log error on execlp failure
Browse files Browse the repository at this point in the history
And exit(1) instead of indicating success.
  • Loading branch information
emersion authored and kennylevinsen committed Apr 22, 2021
1 parent 7beeb9e commit 31a2252
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sway/commands/exec_always.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) {
if ((child = fork()) == 0) {
close(fd[1]);
execlp("sh", "sh", "-c", cmd, (void *)NULL);
_exit(0);
sway_log_errno(SWAY_ERROR, "execlp failed");
_exit(1);
}
ssize_t s = 0;
while ((size_t)s < sizeof(pid_t)) {
Expand Down

0 comments on commit 31a2252

Please sign in to comment.