]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fstrim: fix typo
authorKarel Zak <kzak@redhat.com>
Mon, 4 Oct 2021 09:14:01 +0000 (11:14 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 4 Oct 2021 09:22:32 +0000 (11:22 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/1463
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/fstrim.c

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