summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Henriksson <andreas@fatal.se>2014-09-19 01:36:33 +0200
committerKarel Zak <kzak@redhat.com>2014-10-24 10:20:03 +0200
commitaedbde42432f5d774bb0adb363c5d668423b42ec (patch)
tree81b15b69916b7fab3a68d033685782fa82c9f635
parent13381819b75ce4c9d0934e6783cc2d8aa07a3d53 (diff)
downloadutil-linux-aedbde42432f5d774bb0adb363c5d668423b42ec.tar.gz
libmount: only invoke loopcxt on linux
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>
-rw-r--r--libmount/src/cache.c2
-rw-r--r--libmount/src/tab.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/libmount/src/cache.c b/libmount/src/cache.c
index 8b2e6560f..fcd84fde7 100644
--- a/libmount/src/cache.c
+++ b/libmount/src/cache.c
@@ -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 */
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 4094fb878..011ba5429 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -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) {