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/cd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cd.c') diff --git a/src/cd.c b/src/cd.c index b6742af..1ef1dc5 100644 --- a/src/cd.c +++ b/src/cd.c @@ -96,7 +96,7 @@ cdcmd(int argc, char **argv) const char *path; const char *p; char c; - struct stat statb; + struct stat64 statb; int flags; int len; @@ -132,7 +132,7 @@ dotdot: c = *p; p = stalloc(len); - if (stat(p, &statb) >= 0 && S_ISDIR(statb.st_mode)) { + if (stat64(p, &statb) >= 0 && S_ISDIR(statb.st_mode)) { if (c && c != ':') flags |= CD_PRINT; docd: -- cgit 1.4.1