Commit d4ae291eac1e78e2cd6dfa79a52ee0995957757e Parent: 279dea2d1260957281a327729a23c90961c851d7 Author: mcol <mcol@posteo.net> Date: 2021-02-03 23:28:18 +0000 Committer: mcol <mcol@posteo.net> Committed: 2021-02-03 23:28:18 +0000 log error when failing to exec
src/action.c Modified
@@ -17,10 +17,13 @@ void exec_command(void *data) { - if (fork() == 0) { + pid_t pid = fork(); + if (pid == 0) { if (execl("/bin/sh", "/bin/sh", "-c", data, (void *)NULL) == -1) { exit(EXIT_FAILURE); } + } else if (pid < 0) { + wlr_log(WLR_ERROR, "Failed to execute: %s", data); } else { wlr_log(WLR_DEBUG, "Executing: %s", data); }