fstrim: fix typo

Addresses: https://github.com/karelzak/util-linux/issues/1463
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2021-10-04 11:14:01 +02:00
parent 67f974d41d
commit 1e01704bbc
1 changed files with 1 additions and 1 deletions

View 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);