]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: only invoke loopcxt on linux
authorAndreas Henriksson <andreas@fatal.se>
Thu, 18 Sep 2014 23:36:33 +0000 (01:36 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 22 Sep 2014 10:54:07 +0000 (12:54 +0200)
This is part of an attempt to make libmount buildable on non-linux.

The support for /dev/loop* is Linux-specific so just disable
it on non-linux for now.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
libmount/src/cache.c
libmount/src/tab.c

index 8b2e6560f8ccc6557d1f61c733d9fecdec889f39..fcd84fde7dbb9b04ba5a7b6b0078dc6b05e24b55 100644 (file)
@@ -633,6 +633,7 @@ char *mnt_pretty_path(const char *path, struct libmnt_cache *cache)
        if (!pretty)
                return strdup("none");
 
+#ifdef __linux__
        /* users assume backing file name rather than /dev/loopN in
         * output if the device has been initialized by mount(8).
         */
@@ -653,6 +654,7 @@ char *mnt_pretty_path(const char *path, struct libmnt_cache *cache)
                loopcxt_deinit(&lc);
 
        }
+#endif
 
 done:
        /* don't return pointer to the cache, allocate a new string */
index 4094fb878a481b1b9e29dcc932a0718deb8b9f16..011ba5429106b2eb091b5ac43007078a020112a8 100644 (file)
@@ -1439,8 +1439,10 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
                        } else
                                flags = LOOPDEV_FL_OFFSET;
 
+#if __linux__
                        if (loopdev_is_used(mnt_fs_get_srcpath(fs), src, offset, flags))
                                break;
+#endif
                }
 
                if (root) {