aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriadne Conill <ariadne@dereferenced.org>2021-12-27 13:57:13 -0600
committerTimo Teräs <timo.teras@iki.fi>2021-12-29 07:52:48 +0000
commit2a9c0277c0d633d940a48726b214b89de2957d07 (patch)
tree400d8a36ec8719d08a585c731ad0ead4b7d1433f
parent336a133b7651ef58a9ac075b1a98ef536ea91d4f (diff)
use fstatat, not fstatat64
the stat64 family of functions were provided as transitional functions, but when building on glibc with _GNU_SOURCE, or any other supported system, the stat functions are equivalent to their stat64 counterparts
-rw-r--r--src/database.c6
-rw-r--r--src/io.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/database.c b/src/database.c
index b0c00aa..8698247 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1338,12 +1338,12 @@ static void handle_alarm(int sig)
static char *find_mountpoint(int atfd, const char *rel_path)
{
struct mntent *me;
- struct stat64 st;
+ struct stat st;
FILE *f;
char *ret = NULL;
dev_t dev;
- if (fstatat64(atfd, rel_path, &st, 0) != 0)
+ if (fstatat(atfd, rel_path, &st, 0) != 0)
return NULL;
dev = st.st_dev;
@@ -1353,7 +1353,7 @@ static char *find_mountpoint(int atfd, const char *rel_path)
while ((me = getmntent(f)) != NULL) {
if (strcmp(me->mnt_fsname, "rootfs") == 0)
continue;
- if (fstatat64(atfd, me->mnt_dir, &st, 0) == 0 &&
+ if (fstatat(atfd, me->mnt_dir, &st, 0) == 0 &&
st.st_dev == dev) {
ret = strdup(me->mnt_dir);
break;
diff --git a/src/io.c b/src/io.c
index 5c14ae1..dc7d8b2 100644
--- a/src/io.c
+++ b/src/io.c
@@ -755,7 +755,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)
{
- struct stat64 st;
+ struct stat st;
unsigned int hash_alg = flags & 0xff;
unsigned int xattr_hash_alg = (flags >> 8) & 0xff;
int atflags = 0;
@@ -766,7 +766,7 @@ int apk_fileinfo_get(int atfd, const char *filename, unsigned int flags,
if (flags & APK_FI_NOFOLLOW)
atflags |= AT_SYMLINK_NOFOLLOW;
- if (fstatat64(atfd, filename, &st, atflags) != 0)
+ if (fstatat(atfd, filename, &st, atflags) != 0)
return -errno;
*fi = (struct apk_file_info) {