summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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] ;