diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-08-22 15:10:36 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-08-22 15:10:36 +0000 |
commit | 523036ef1e6e4bd7047ec21a6e68b7508569db91 (patch) | |
tree | 2612ec7431849a5b5d2b8b926dc8479a0f02e9e4 /src | |
parent | 6ead33f5fe46f38a63532daa95ec96bd39ecbfd8 (diff) | |
download | execline-523036ef1e6e4bd7047ec21a6e68b7508569db91.tar.xz |
More conversion to xpathexec, make exit code change consistent across binaries
Diffstat (limited to 'src')
-rw-r--r-- | src/execline/background.c | 3 | ||||
-rw-r--r-- | src/execline/pipeline.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/execline/background.c b/src/execline/background.c index dc7a01a..e8def5b 100644 --- a/src/execline/background.c +++ b/src/execline/background.c @@ -2,6 +2,7 @@ #include <sys/types.h> #include <unistd.h> +#include <errno.h> #include <skalibs/sgetopt.h> #include <skalibs/strerr2.h> #include <skalibs/env.h> @@ -46,7 +47,7 @@ int main (int argc, char const **argv, char const *const *envp) case 0: PROG = "background (grandchild)" ; pathexec0_run(argv, envp) ; - strerr_dieexec(127, argv[0]) ; + strerr_dieexec(errno == ENOENT ? 127 : 126, argv[0]) ; } } else diff --git a/src/execline/pipeline.c b/src/execline/pipeline.c index 3017ea2..f61c35b 100644 --- a/src/execline/pipeline.c +++ b/src/execline/pipeline.c @@ -2,6 +2,7 @@ #include <sys/types.h> #include <unistd.h> +#include <errno.h> #include <skalibs/sgetopt.h> #include <skalibs/types.h> #include <skalibs/strerr2.h> @@ -52,7 +53,7 @@ int main (int argc, char const **argv, char const *const *envp) fd_close(p[w]) ; if (fd_move(!w, p[!w]) < 0) strerr_diefu1sys(111, "fd_move") ; pathexec0_run(argv, envp) ; - strerr_dieexec(127, argv[0]) ; + strerr_dieexec(errno == ENOENT ? 127 : 126, argv[0]) ; } fd_close(p[!w]) ; fd = p[w] ; |