aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2021-04-16 10:32:32 +0200
committerLibravatar Kenny Levinsen <kl@kl.wtf>2021-04-22 23:12:49 +0200
commit31a2252e83a39ae9be8f9572179fe161c54f715d (patch)
treeac726738dbb7ea1cc879484312d0bb302d1048f2
parentUse execlp("sh") instead of execl("/bin/sh") (diff)
downloadsway-31a2252e83a39ae9be8f9572179fe161c54f715d.tar.gz
sway-31a2252e83a39ae9be8f9572179fe161c54f715d.tar.zst
sway-31a2252e83a39ae9be8f9572179fe161c54f715d.zip
commands/exec_always: log error on execlp failure
And exit(1) instead of indicating success.
-rw-r--r--sway/commands/exec_always.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c
index 3786bfb7..781c86c9 100644
--- a/sway/commands/exec_always.c
+++ b/sway/commands/exec_always.c
@@ -66,7 +66,8 @@ struct cmd_results *cmd_exec_process(int argc, char **argv) {
66 if ((child = fork()) == 0) { 66 if ((child = fork()) == 0) {
67 close(fd[1]); 67 close(fd[1]);
68 execlp("sh", "sh", "-c", cmd, (void *)NULL); 68 execlp("sh", "sh", "-c", cmd, (void *)NULL);
69 _exit(0); 69 sway_log_errno(SWAY_ERROR, "execlp failed");
70 _exit(1);
70 } 71 }
71 ssize_t s = 0; 72 ssize_t s = 0;
72 while ((size_t)s < sizeof(pid_t)) { 73 while ((size_t)s < sizeof(pid_t)) {