Fri, 20 Jun 2025 17:15:18 +0200
fix wrong return value of process::exec()
src/process.cpp | file | annotate | diff | comparison | revisions |
--- a/src/process.cpp Mon May 19 16:05:58 2025 +0200 +++ b/src/process.cpp Fri Jun 20 17:15:18 2025 +0200 @@ -108,8 +108,11 @@ // wait for the process to completely finish int status = -1; waitpid(pid, &status, 0); - - return status; + if (WIFEXITED(status)) { + return WEXITSTATUS(status); + } else { + return -1; + } } else { perror("fork"); return -1;