summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-08-22 15:10:36 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-08-22 15:10:36 +0000
commit523036ef1e6e4bd7047ec21a6e68b7508569db91 (patch)
tree2612ec7431849a5b5d2b8b926dc8479a0f02e9e4 /src
parent6ead33f5fe46f38a63532daa95ec96bd39ecbfd8 (diff)
downloadexecline-523036ef1e6e4bd7047ec21a6e68b7508569db91.tar.xz
More conversion to xpathexec, make exit code change consistent across binaries
Diffstat (limited to 'src')
-rw-r--r--src/execline/background.c3
-rw-r--r--src/execline/pipeline.c3
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] ;