From 3e3e7af1a49273a5e49d50565b3b079a2ab19142 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 7 May 2020 23:42:12 +1000 Subject: shell: Always use explicit large file API There are some remaining stat/readdir calls in dash that may lead to spurious EOVERFLOW errors on 32-bit platforms. This patch changes them (as well as open(2)) to use the explicit large file API. Reported-by: Tatsuki Sugiura Signed-off-by: Herbert Xu --- src/jobs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/jobs.c') diff --git a/src/jobs.c b/src/jobs.c index a9e6524..f65435d 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -196,7 +196,7 @@ setjobctl(int on) return; if (on) { int ofd; - ofd = fd = open(_PATH_TTY, O_RDWR); + ofd = fd = open64(_PATH_TTY, O_RDWR); if (fd < 0) { fd += 3; while (!isatty(fd)) @@ -887,7 +887,7 @@ static void forkchild(struct job *jp, union node *n, int mode) ignoresig(SIGQUIT); if (jp->nprocs == 0) { close(0); - if (open(_PATH_DEVNULL, O_RDONLY) != 0) + if (open64(_PATH_DEVNULL, O_RDONLY) != 0) sh_error("Can't open %s", _PATH_DEVNULL); } } -- cgit 1.4.1