diff options
56 files changed, 109 insertions, 114 deletions
diff --git a/catgets/open_catalog.c b/catgets/open_catalog.c index 6b14963d78..cf8d635ae7 100644 --- a/catgets/open_catalog.c +++ b/catgets/open_catalog.c @@ -194,7 +194,7 @@ __open_catalog (const char *cat_name, const char *nlspath, const char *env_var, return -1; } - if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0) + if (__builtin_expect (__fstat64 (fd, &st), 0) < 0) goto close_unlock_return; if (__builtin_expect (!S_ISREG (st.st_mode), 0) diff --git a/csu/check_fds.c b/csu/check_fds.c index 30634b81a7..29d9d04acb 100644 --- a/csu/check_fds.c +++ b/csu/check_fds.c @@ -71,7 +71,7 @@ check_one_fd (int fd, int mode) decsriptor numbers, in this order. */ struct stat64 st; if (__builtin_expect (nullfd != fd, 0) - || __builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) != 0 + || __builtin_expect (__fstat64 (fd, &st), 0) != 0 || __builtin_expect (S_ISCHR (st.st_mode), 1) == 0 || st.st_rdev != dev) /* We cannot even give an error message here since it would diff --git a/elf/cache.c b/elf/cache.c index d92b4e59c1..1eb1455883 100644 --- a/elf/cache.c +++ b/elf/cache.c @@ -163,7 +163,7 @@ print_cache (const char *cache_name) error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"), cache_name); struct stat64 st; - if (fstat64 (fd, &st) < 0 + if (__fstat64 (fd, &st) < 0 /* No need to map the file if it is empty. */ || st.st_size == 0) { @@ -699,7 +699,7 @@ load_aux_cache (const char *aux_cache_name) } struct stat64 st; - if (fstat64 (fd, &st) < 0 || st.st_size < sizeof (struct aux_cache_file)) + if (__fstat64 (fd, &st) < 0 || st.st_size < sizeof (struct aux_cache_file)) { close (fd); init_aux_cache (); diff --git a/elf/dl-load.c b/elf/dl-load.c index e39980fb19..646c5dca40 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -1914,7 +1914,7 @@ open_path (const char *name, size_t namelen, int mode, buf[buflen - namelen - 1] = '\0'; - if (__xstat64 (_STAT_VER, buf, &st) != 0 + if (__stat64 (buf, &st) != 0 || ! S_ISDIR (st.st_mode)) /* The directory does not exist or it is no directory. */ this_dir->status[cnt] = nonexisting; @@ -1934,7 +1934,7 @@ open_path (const char *name, size_t namelen, int mode, directories and so exploit the bugs. */ struct stat64 st; - if (__fxstat64 (_STAT_VER, fd, &st) != 0 + if (__fstat64 (fd, &st) != 0 || (st.st_mode & S_ISUID) == 0) { /* The shared object cannot be tested for being SUID diff --git a/elf/dl-misc.c b/elf/dl-misc.c index f9d1fd7993..aee62e1e60 100644 --- a/elf/dl-misc.c +++ b/elf/dl-misc.c @@ -47,7 +47,7 @@ _dl_sysdep_read_whole_file (const char *file, size_t *sizep, int prot) int fd = __open64_nocancel (file, O_RDONLY | O_CLOEXEC); if (fd >= 0) { - if (__fxstat64 (_STAT_VER, fd, &st) >= 0) + if (__fstat64 (fd, &st) >= 0) { *sizep = st.st_size; diff --git a/elf/dl-profile.c b/elf/dl-profile.c index c681f5415c..89dd70ba3b 100644 --- a/elf/dl-profile.c +++ b/elf/dl-profile.c @@ -342,7 +342,7 @@ _dl_start_profile (void) return; } - if (__fxstat64 (_STAT_VER, fd, &st) < 0 || !S_ISREG (st.st_mode)) + if (__fstat64 (fd, &st) < 0 || !S_ISREG (st.st_mode)) { /* Not stat'able or not a regular file => don't use it. */ errstr = "%s: cannot stat file: %s\n"; diff --git a/iconv/gconv_cache.c b/iconv/gconv_cache.c index 9fe371b4c0..b326cd19e2 100644 --- a/iconv/gconv_cache.c +++ b/iconv/gconv_cache.c @@ -64,7 +64,7 @@ __gconv_load_cache (void) return -1; /* Get information about the file. */ - if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0 + if (__builtin_expect (__fstat64 (fd, &st), 0) < 0 /* We do not have to start looking at the file if it cannot contain at least the cache header. */ || (size_t) st.st_size < sizeof (struct gconvcache_header)) diff --git a/include/sys/stat.h b/include/sys/stat.h index 92284ca48b..f8847cf73e 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -53,6 +53,7 @@ extern __typeof (__fxstatat64) __fxstatat64 attribute_hidden; #define lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf) #define __lstat64(fname, buf) __lxstat64 (_STAT_VER, fname, buf) #define stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf) +#define __stat64(fname, buf) __xstat64 (_STAT_VER, fname, buf) #define fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf) #define __fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf) #define fstat(fd, buf) __fxstat (_STAT_VER, fd, buf) diff --git a/inet/rcmd.c b/inet/rcmd.c index 8a9616f847..452ff7d099 100644 --- a/inet/rcmd.c +++ b/inet/rcmd.c @@ -474,7 +474,7 @@ iruserfopen (const char *file, uid_t okuser) /* If not a regular file, if owned by someone other than user or root, if writeable by anyone but the owner, or if hardlinked anywhere, quit. */ - if (__lxstat64 (_STAT_VER, file, &st)) + if (__lstat64 (file, &st)) cp = _("lstat failed"); else if (!S_ISREG (st.st_mode)) cp = _("not regular file"); @@ -483,7 +483,7 @@ iruserfopen (const char *file, uid_t okuser) res = fopen (file, "rce"); if (!res) cp = _("cannot open"); - else if (__fxstat64 (_STAT_VER, fileno (res), &st) < 0) + else if (__fstat64 (fileno (res), &st) < 0) cp = _("fstat failed"); else if (st.st_uid && st.st_uid != okuser) cp = _("bad owner"); diff --git a/inet/ruserpass.c b/inet/ruserpass.c index 4fa6520c1a..d61a72877d 100644 --- a/inet/ruserpass.c +++ b/inet/ruserpass.c @@ -174,7 +174,7 @@ next: break; case PASSWD: if (strcmp(*aname, "anonymous") && - fstat64(fileno(cfile), &stb) >= 0 && + __fstat64(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { warnx(_("Error: .netrc file is readable by others.")); warnx(_("Remove 'password' line or make file unreadable by others.")); diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c index 91c1ef156a..d44a4a0b14 100644 --- a/intl/loadmsgcat.c +++ b/intl/loadmsgcat.c @@ -804,7 +804,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file, /* We must know about the size of the file. */ if ( #ifdef _LIBC - __builtin_expect (fstat64 (fd, &st) != 0, 0) + __builtin_expect (__fstat64 (fd, &st) != 0, 0) #else __builtin_expect (fstat (fd, &st) != 0, 0) #endif diff --git a/io/file_change_detection.c b/io/file_change_detection.c index c6d700ed05..f52d8fecfa 100644 --- a/io/file_change_detection.c +++ b/io/file_change_detection.c @@ -67,7 +67,7 @@ __file_change_detection_for_path (struct file_change_detection *file, const char *path) { struct stat64 st; - if (stat64 (path, &st) != 0) + if (__stat64 (path, &st) != 0) switch (errno) { case EACCES: @@ -105,7 +105,7 @@ __file_change_detection_for_fp (struct file_change_detection *file, else { struct stat64 st; - if (fstat64 (__fileno (fp), &st) != 0) + if (__fstat64 (__fileno (fp), &st) != 0) /* If we already have a file descriptor, all errors are fatal. */ return false; else @@ -81,8 +81,9 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; # define FTSOBJ FTS # define FTSENTRY FTSENT # define INO_T ino_t -# define STAT stat -# define LSTAT lstat +# define STRUCT_STAT stat +# define STAT __stat +# define LSTAT __lstat #endif static FTSENTRY *fts_alloc (FTSOBJ *, const char *, size_t); @@ -872,7 +873,7 @@ fts_stat (FTSOBJ *sp, FTSENTRY *p, int follow) FTSENTRY *t; dev_t dev; INO_T ino; - struct STAT *sbp, sb; + struct STRUCT_STAT *sbp, sb; int saved_errno; /* If user needs stat info, stat buffer already allocated. */ @@ -906,7 +907,7 @@ fts_stat (FTSOBJ *sp, FTSENTRY *p, int follow) } } else if (LSTAT(p->fts_accpath, sbp)) { p->fts_errno = errno; -err: memset(sbp, 0, sizeof(struct STAT)); +err: memset(sbp, 0, sizeof(struct STRUCT_STAT)); return (FTS_NS); } @@ -996,7 +997,7 @@ fts_alloc (FTSOBJ *sp, const char *name, size_t namelen) */ len = sizeof(FTSENTRY) + namelen; if (!ISSET(FTS_NOSTAT)) - len += sizeof(struct STAT) + ALIGNBYTES; + len += sizeof(struct STRUCT_STAT) + ALIGNBYTES; if ((p = malloc(len)) == NULL) return (NULL); @@ -1005,7 +1006,7 @@ fts_alloc (FTSOBJ *sp, const char *name, size_t namelen) p->fts_name[namelen] = '\0'; if (!ISSET(FTS_NOSTAT)) - p->fts_statp = (struct STAT *)ALIGN(p->fts_name + namelen + 2); + p->fts_statp = (struct STRUCT_STAT *)ALIGN(p->fts_name + namelen + 2); p->fts_namelen = namelen; p->fts_path = sp->fts_path; p->fts_errno = 0; @@ -1116,7 +1117,7 @@ fts_safe_changedir (FTSOBJ *sp, FTSENTRY *p, int fd, const char *path) return (0); if (fd < 0 && (newfd = __open(path, O_RDONLY, 0)) < 0) return (-1); - if (__fxstat64(_STAT_VER, newfd, &sb)) { + if (__fstat64(newfd, &sb)) { ret = -1; goto bail; } |
