From 1e01704bbcdf74d39bd770c6bf1f437674085c8c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 4 Oct 2021 11:14:01 +0200 Subject: [PATCH] fstrim: fix typo Addresses: https://github.com/karelzak/util-linux/issues/1463 Signed-off-by: Karel Zak --- sys-utils/fstrim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c index ea787f42cf..88397f0ec3 100644 --- a/sys-utils/fstrim.c +++ b/sys-utils/fstrim.c @@ -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); -- 2.47.2