]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fstrim: fix paths comparison
authorKarel Zak <kzak@redhat.com>
Thu, 20 May 2021 07:25:46 +0000 (09:25 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 20 May 2021 07:29:34 +0000 (09:29 +0200)
Fix: https://github.com/karelzak/util-linux/issues/1312
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/fstrim.c

index e8f00608391b07ee2ff6c6065b414de601411831..1ca117071a4ff1c7ab8b35dab1b042a549f67d62 100644 (file)
@@ -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)