From 3e8403522c6e28fa1fa5bdea1462822deb7ce303 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 20 May 2021 09:25:46 +0200 Subject: [PATCH] fstrim: fix paths comparison Fix: https://github.com/karelzak/util-linux/issues/1312 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 e8f006083..1ca117071 100644 --- a/sys-utils/fstrim.c +++ b/sys-utils/fstrim.c @@ -330,7 +330,7 @@ static int fstrim_all_from_file(struct fstrim_control *ctl, const char *filename /* Is it really accessible mountpoint? Not all mountpoints are * accessible (maybe over mounted by another filesystem) */ path = mnt_get_mountpoint(tgt); - if (path && strcmp(path, tgt) == 0) + if (path && streq_paths(path, tgt)) rc = 0; free(path); if (rc)