From 22fb2a07db173532462d90ad875a06254e932773 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Fri, 21 Jan 2022 22:26:28 -0500 Subject: dash: Stop this stat64 nonsense --- src/bltin/test.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/bltin/test.c') diff --git a/src/bltin/test.c b/src/bltin/test.c index c7fc479..342ccdb 100644 --- a/src/bltin/test.c +++ b/src/bltin/test.c @@ -151,7 +151,7 @@ static int equalf(const char *, const char *); #ifdef HAVE_FACCESSAT static int test_file_access(const char *, int); #else -static int test_access(const struct stat64 *, int); +static int test_access(const struct stat *, int); #endif #ifdef HAVE_FACCESSAT @@ -388,9 +388,9 @@ binop(void) static int filstat(char *nm, enum token mode) { - struct stat64 s; + struct stat s; - if (mode == FILSYM ? lstat64(nm, &s) : stat64(nm, &s)) + if (mode == FILSYM ? lstat(nm, &s) : stat(nm, &s)) return 0; switch (mode) { @@ -473,17 +473,17 @@ static int isoperand(char **tp) static int newerf (const char *f1, const char *f2) { - struct stat64 b1, b2; + struct stat b1, b2; #ifdef HAVE_ST_MTIM - return (stat64(f1, &b1) == 0 && - stat64(f2, &b2) == 0 && + return (stat(f1, &b1) == 0 && + stat(f2, &b2) == 0 && ( b1.st_mtim.tv_sec > b2.st_mtim.tv_sec || (b1.st_mtim.tv_sec == b2.st_mtim.tv_sec && (b1.st_mtim.tv_nsec > b2.st_mtim.tv_nsec ))) ); #else - return (stat64(f1, &b1) == 0 && - stat64(f2, &b2) == 0 && + return (stat(f1, &b1) == 0 && + stat(f2, &b2) == 0 && b1.st_mtime > b2.st_mtime); #endif } @@ -491,17 +491,17 @@ newerf (const char *f1, const char *f2) static int olderf (const char *f1, const char *f2) { - struct stat64 b1, b2; + struct stat b1, b2; #ifdef HAVE_ST_MTIM - return (stat64(f1, &b1) == 0 && - stat64(f2, &b2) == 0 && + return (stat(f1, &b1) == 0 && + stat(f2, &b2) == 0 && (b1.st_mtim.tv_sec < b2.st_mtim.tv_sec || (b1.st_mtim.tv_sec == b2.st_mtim.tv_sec && (b1.st_mtim.tv_nsec < b2.st_mtim.tv_nsec ))) ); #else - return (stat64(f1, &b1) == 0 && - stat64(f2, &b2) == 0 && + return (stat(f1, &b1) == 0 && + stat(f2, &b2) == 0 && b1.st_mtime < b2.st_mtime); #endif } @@ -509,10 +509,10 @@ olderf (const char *f1, const char *f2) static int equalf (const char *f1, const char *f2) { - struct stat64 b1, b2; + struct stat b1, b2; - return (stat64(f1, &b1) == 0 && - stat64(f2, &b2) == 0 && + return (stat(f1, &b1) == 0 && + stat(f2, &b2) == 0 && b1.st_dev == b2.st_dev && b1.st_ino == b2.st_ino); } @@ -520,9 +520,9 @@ equalf (const char *f1, const char *f2) #ifdef HAVE_FACCESSAT static int has_exec_bit_set(const char *path) { - struct stat64 st; + struct stat st; - if (stat64(path, &st)) + if (stat(path, &st)) return 0; return st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH); } @@ -657,7 +657,7 @@ static int test_file_access(const char *path, int mode) * (euid==uid&&egid==gid), but uses st_mode for '-x' iff running as root. * i.e. it does strictly conform to 1003.1-2001 (and presumably 1003.2b). */ -static int test_access(const struct stat64 *sp, int stmode) +static int test_access(const struct stat *sp, int stmode) { gid_t *groups; register int n; -- cgit 1.4.1 L / palaver optionJune McEnroe 2020-08-11contrib/palaver: Document service configurationJune McEnroe 2020-08-11contrib/palaver: Add install target and rc scriptJune McEnroe 2020-08-11contrib/palaver: Implement command and notificationsJune McEnroe-19 18:05:09 -0500'>2020-02-19Add The Obelisk GateJune McEnroe 2020-02-17Add Four Tet — HandsJune McEnroe One from the cafe that caught my attention. 2020-02-12Simplify macOS notify-sendJune McEnroe 2020-02-12Add imbox and notemap to pageJune McEnroe 2020-02-12Collapse simple linksJune McEnroe 2020-02-12Move catgirl up the pageJune McEnroe 2020-02-12Update catgirl pty grabJune McEnroe 2020-02-12Link to cgit /about pages where appropriateJune McEnroe 2020-02-11Separate LINKS from BINS for html to workJune McEnroe 2020-02-11Add margin to Bl-bullet itemsJune McEnroe 2020-02-10Match URLs inside parens or with paired parens insideJune McEnroe 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe Apparently sometimes it didn't like receiving its own internal storage to parse again. Understandable. 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe Wow. One of the best I've read. 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe Broke out LDLIBS for each bin, and made everything more uniform. 2020-01-28Change scout sensitivity to 1.4June McEnroe idk it seems to work. 2020-01-28Import shows.txtJune McEnroe