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