summaryrefslogtreecommitdiffstats
path: root/text-utils/more.c
diff options
context:
space:
mode:
Diffstat (limited to 'text-utils/more.c')
-rw-r--r--text-utils/more.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/text-utils/more.c b/text-utils/more.c
index cbff39b11..0b2db22f3 100644
--- a/text-utils/more.c
+++ b/text-utils/more.c
@@ -1619,6 +1619,7 @@ void execute(char *filename, char *cmd, ...)
for (n = 10; (id = fork()) < 0 && n > 0; n--)
sleep(5);
if (id == 0) {
+ int errsv;
if (!isatty(0)) {
close(0);
open("/dev/tty", 0);
@@ -1647,8 +1648,9 @@ void execute(char *filename, char *cmd, ...)
va_end(argp);
execvp(cmd, args);
+ errsv = errno;
putserr(_("exec failed\n"));
- exit(EXIT_FAILURE);
+ exit(errsv == ENOENT ? EX_EXEC_ENOENT : EX_EXEC_FAILED);
}
if (id > 0) {
signal(SIGINT, SIG_IGN);