fd-util: minor shortcut

This commit is contained in:
Lennart Poettering
2026-03-03 08:48:01 +01:00
parent 4023840ffa
commit e4206858ad
+3
View File
@@ -1085,6 +1085,9 @@ int fds_inode_and_mount_same(int fd1, int fd2) {
if (r < 0)
return r;
if (fd1 == fd2) /* Shortcut things if fds are the same (only after validating the fd) */
return true;
r = xstatx(fd2, /* path = */ NULL, AT_EMPTY_PATH,
STATX_TYPE|STATX_INO|STATX_MNT_ID,
&sx2);