From 8e5f4910f8ae653f4ff30c0b3c23a4b659036f9b Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Mon, 13 Dec 2021 11:47:57 -0600 Subject: apk_defines: define stub stat64/fstatat64 symbols for macOS variants with only 64-bit ino_t ref #10794 --- src/apk_defines.h | 5 +++++ src/io.c | 9 --------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/apk_defines.h b/src/apk_defines.h index 3626495..f4b9c85 100644 --- a/src/apk_defines.h +++ b/src/apk_defines.h @@ -34,6 +34,11 @@ #define NULL 0L #endif +#if __DARWIN_ONLY_64_BIT_INO_T +# define stat64 stat +# define fstatat64 fstatat +#endif + enum { APKE_EOF = 1024, APKE_DNS, diff --git a/src/io.c b/src/io.c index 5c871bd..498ba71 100644 --- a/src/io.c +++ b/src/io.c @@ -751,11 +751,7 @@ void apk_fileinfo_hash_xattr(struct apk_file_info *fi, uint8_t alg) int apk_fileinfo_get(int atfd, const char *filename, unsigned int flags, struct apk_file_info *fi, struct apk_atom_pool *atoms) { -#ifdef __linux__ struct stat64 st; -#else - struct stat st; -#endif unsigned int hash_alg = flags & 0xff; unsigned int xattr_hash_alg = (flags >> 8) & 0xff; int atflags = 0; @@ -766,13 +762,8 @@ int apk_fileinfo_get(int atfd, const char *filename, unsigned int flags, if (flags & APK_FI_NOFOLLOW) atflags |= AT_SYMLINK_NOFOLLOW; -#ifdef __linux__ if (fstatat64(atfd, filename, &st, atflags) != 0) return -errno; -#else - if (fstatat(atfd, filename, &st, atflags) != 0) - return -errno; -#endif *fi = (struct apk_file_info) { .size = st.st_size, -- cgit v1.2.3-70-g09d2