d017ad
From 825f9a8eb7800c572d4ded17dd202249312e3240 Mon Sep 17 00:00:00 2001
d017ad
From: Karel Zak <kzak@redhat.com>
d017ad
Date: Mon, 4 Oct 2021 11:14:01 +0200
d017ad
Subject: fstrim: fix typo
d017ad
d017ad
Addresses: https://github.com/karelzak/util-linux/issues/1463
d017ad
Signed-off-by: Karel Zak <kzak@redhat.com>
d017ad
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2165981
d017ad
---
d017ad
 sys-utils/fstrim.c | 2 +-
d017ad
 1 file changed, 1 insertion(+), 1 deletion(-)
d017ad
d017ad
diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c
d017ad
index ea787f42c..88397f0ec 100644
d017ad
--- a/sys-utils/fstrim.c
d017ad
+++ b/sys-utils/fstrim.c
d017ad
@@ -226,7 +226,7 @@ static int is_unwanted_fs(struct libmnt_fs *fs, const char *tgt)
d017ad
 		return 1;
d017ad
 
d017ad
 	fd = open(tgt, O_PATH);
d017ad
-	if (!fd)
d017ad
+	if (fd < 0)
d017ad
 		return 1;
d017ad
 	rc = fstatfs(fd, &vfs) != 0 || vfs.f_type == STATFS_AUTOFS_MAGIC;
d017ad
 	close(fd);
d017ad
-- 
d017ad
2.39.1
d017ad