diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2025-06-10 11:45:31 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-10-16 15:14:37 +0200 |
| commit | c7b8f3ec1a25a31bc08e74910a5632c766da4971 (patch) | |
| tree | 08e3a3550035ac9ca115aed69b919a064f75d28d | |
| parent | 512920e7a32d4950bcdfad4286c895631bb428a9 (diff) | |
daemon: ‘runProgram’ exits with 127 upon ENOENT or similar.
This is in accordance with widespread conventions. Previously it would
exit with code 1, which was misleading.
* nix/libutil/util.cc (runProgram): Exit with 127 if ‘execv’ or ‘execvp’
fails.
Change-Id: I5df214afffda69aa329a25afbc48f6cbfdd0961c
| -rw-r--r-- | nix/libutil/util.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nix/libutil/util.cc b/nix/libutil/util.cc index 9a97270af90..77f2547b0a5 100644 --- a/nix/libutil/util.cc +++ b/nix/libutil/util.cc @@ -1193,7 +1193,9 @@ string runProgram(Path program, bool searchPath, const Strings & args) else execv(program.c_str(), stringsToCharPtrs(args_).data()); - throw SysError(format("executing `%1%'") % program); + int err = errno; + printMsg(lvlError, format("executing `%1%': %2%") % program % strerror(err)); + _exit(127); }); pipe.writeSide.close(); |
