]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fstrim: use F_TYPE_EQUAL() macro for statfs.f_type comparison
authorcgoesche <cgoesc2@wgu.edu>
Sat, 23 Aug 2025 01:01:16 +0000 (21:01 -0400)
committercgoesche <cgoesc2@wgu.edu>
Sat, 23 Aug 2025 01:01:16 +0000 (21:01 -0400)
Addresses: #2332
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
sys-utils/fstrim.c

index 4d43c795729c68a27773406d2975446db8fc09f4..0e31e7e576e1643e5f251f6c8ab8d361334dbe9a 100644 (file)
@@ -234,7 +234,7 @@ static int is_unwanted_fs(struct libmnt_fs *fs, const char *tgt, const char *typ
        fd = open(tgt, O_PATH);
        if (fd < 0)
                return 1;
-       rc = fstatfs(fd, &vfs) != 0 || vfs.f_type == STATFS_AUTOFS_MAGIC;
+       rc = fstatfs(fd, &vfs) != 0 || F_TYPE_EQUAL(vfs.f_type, STATFS_AUTOFS_MAGIC);
        close(fd);
        if (rc)
                return 1;