diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-08-28 18:07:30 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-08-28 18:12:11 +0200 |
commit | b1ba703f2ddb6707f5931faa88b4ad8a6c07a7e8 (patch) | |
tree | 21cd9e2d771e685ff6660692171feec43b604d2b | |
parent | ba5fbfe36fd9934398e8030253c4d0b87c81fd03 (diff) |
Call _exit if execv fails in child process.
-rw-r--r-- | execute.cc | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -66,6 +66,9 @@ int execute(const std::string& command, if(pid == 0) { execv(command.data(), (char**)argv.data()); + std::cout << "Could not execute " << command << ": " << + strerror(errno) << "\n"; + _exit(1); // execv only returns if an error occurred } auto ret = parent_waitpid(pid); #elif 0 |