]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: fix warning "set but not used"
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 15 Jun 2017 06:56:01 +0000 (08:56 +0200)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 15 Jun 2017 06:56:01 +0000 (08:56 +0200)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
libmount/src/tab.c

index 10da730e3e0296c22f344f53d9c3a40696e5faa3..760b95b5fb4a9111977688d579b63aad2f74393c 100644 (file)
@@ -1422,7 +1422,6 @@ struct libmnt_fs *mnt_table_get_fs_root(struct libmnt_table *tb,
 {
        char *root = NULL;
        const char *mnt = NULL;
-       const char *fstype;
        struct libmnt_fs *src_fs = NULL;
 
        assert(fs);
@@ -1430,8 +1429,6 @@ struct libmnt_fs *mnt_table_get_fs_root(struct libmnt_table *tb,
 
        DBG(TAB, ul_debug("lookup fs-root for '%s'", mnt_fs_get_source(fs)));
 
-       fstype = mnt_fs_get_fstype(fs);
-
        if (tb && (mountflags & MS_BIND)) {
                const char *src, *src_root;
                char *xsrc = NULL;
@@ -1496,7 +1493,8 @@ struct libmnt_fs *mnt_table_get_fs_root(struct libmnt_table *tb,
        /*
         * btrfs-subvolume mount -- get subvolume name and use it as a root-fs path
         */
-       else if (tb && fstype && (!strcmp(fstype, "btrfs") || !strcmp(fstype, "auto"))) {
+       else if (tb && fs->fstype &&
+                (!strcmp(fs->fstype, "btrfs") || !strcmp(fs->fstype, "auto"))) {
                if (get_btrfs_fs_root(tb, fs, &root) < 0)
                        goto err;
        }