From: Eric Rannaud Date: Fri, 27 Jun 2014 05:17:16 +0000 (-0700) Subject: libmount: mnt_resolve_path: use strcmp() only if both are canonical X-Git-Tag: v2.25-rc2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab131f00a2a5b81fbdf362b0b452291298523031;p=thirdparty%2Futil-linux.git libmount: mnt_resolve_path: use strcmp() only if both are canonical Signed-off-by: Eric Rannaud --- diff --git a/libmount/src/fs.c b/libmount/src/fs.c index cae7ce648c..949e718f4c 100644 --- a/libmount/src/fs.c +++ b/libmount/src/fs.c @@ -1434,7 +1434,7 @@ int mnt_fs_match_target(struct libmnt_fs *fs, const char *target, if (!rc && cache) { /* 2) - canonicalized and non-canonicalized */ char *cn = mnt_resolve_path(target, cache); - rc = (cn && strcmp(cn, fs->target) == 0); + rc = (cn && mnt_fs_streq_target(fs, cn)); /* 3) - canonicalized and canonicalized */ if (!rc && cn && !mnt_fs_is_kernel(fs)) {