stat-util: drop statx_fallback()

Now both our required baseline of glibc and kernel support statx.
This commit is contained in:
Yu Watanabe
2025-03-01 00:33:32 +09:00
parent 998e6394ea
commit d5ddc0e0d3
7 changed files with 38 additions and 121 deletions
+4 -6
View File
@@ -1093,13 +1093,11 @@ int fds_are_same_mount(int fd1, int fd2) {
assert(fd1 >= 0);
assert(fd2 >= 0);
r = statx_fallback(fd1, "", AT_EMPTY_PATH, STATX_TYPE|STATX_INO|STATX_MNT_ID, &sx1);
if (r < 0)
return r;
if (statx(fd1, "", AT_EMPTY_PATH, STATX_TYPE|STATX_INO|STATX_MNT_ID, &sx1) < 0)
return -errno;
r = statx_fallback(fd2, "", AT_EMPTY_PATH, STATX_TYPE|STATX_INO|STATX_MNT_ID, &sx2);
if (r < 0)
return r;
if (statx(fd2, "", AT_EMPTY_PATH, STATX_TYPE|STATX_INO|STATX_MNT_ID, &sx2) < 0)
return -errno;
/* First, compare inode. If these are different, the fd does not point to the root directory "/". */
if (!statx_inode_same(&sx1, &sx2))