summaryrefslogtreecommitdiffstats
path: root/libblkid
diff options
context:
space:
mode:
authorSamuel Thibault2012-08-08 17:19:43 +0200
committerKarel Zak2012-08-13 15:14:13 +0200
commit4797b1e5928219864215c7b7cf9e6d023e345675 (patch)
tree3bc7d410acb2ccffac9335eae57a32f3bd7940fa /libblkid
parentfdisk: aix: fix warning (diff)
downloadkernel-qcow2-util-linux-4797b1e5928219864215c7b7cf9e6d023e345675.tar.gz
kernel-qcow2-util-linux-4797b1e5928219864215c7b7cf9e6d023e345675.tar.xz
kernel-qcow2-util-linux-4797b1e5928219864215c7b7cf9e6d023e345675.zip
Fix non-Linux build
loopdev.c, test_pager, and get_max_number_of_cpus() are linux-specific. get_linux_version will only work on Linux, let's introduce system_supports_ext4_ext2() which assumes that mounting ext2 with ext4 is not supported on non-Linux systems. [kzak@redhat.com: - use #ifdef SYS_sched_getaffinity rather than __linux__] Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid')
-rw-r--r--libblkid/src/superblocks/ext.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libblkid/src/superblocks/ext.c b/libblkid/src/superblocks/ext.c
index 4066347cd..eff96a066 100644
--- a/libblkid/src/superblocks/ext.c
+++ b/libblkid/src/superblocks/ext.c
@@ -257,6 +257,15 @@ static int system_supports_ext4dev(void)
ret = (fs_proc_check("ext4dev") || check_for_modules("ext4dev"));
return ret;
}
+
+static int system_supports_ext4_ext2(void)
+{
+#ifdef __linux__
+ return get_linux_version() >= EXT4_SUPPORTS_EXT2;
+#else
+ return 0;
+#endif
+}
/*
* reads superblock and returns:
* fc = feature_compat
@@ -352,7 +361,7 @@ static int probe_ext2(blkid_probe pr,
*/
if (!system_supports_ext2() &&
(system_supports_ext4() || system_supports_ext4dev()) &&
- get_linux_version() >= EXT4_SUPPORTS_EXT2)
+ system_supports_ext4_ext2())
return -BLKID_ERR_PARAM;
ext_get_info(pr, 2, es);
@@ -405,7 +414,7 @@ static int probe_ext4dev(blkid_probe pr,
if (!(fc & EXT3_FEATURE_COMPAT_HAS_JOURNAL) &&
!system_supports_ext2() && !system_supports_ext4() &&
system_supports_ext4dev() &&
- get_linux_version() >= EXT4_SUPPORTS_EXT2)
+ system_supports_ext4_ext2())
goto force_ext4dev;
/*
@@ -450,7 +459,7 @@ static int probe_ext4(blkid_probe pr,
*/
if (!(fc & EXT3_FEATURE_COMPAT_HAS_JOURNAL) &&
!system_supports_ext2() && system_supports_ext4() &&
- get_linux_version() >= EXT4_SUPPORTS_EXT2)
+ system_supports_ext4_ext2())
goto force_ext4;
/* Ext4 has at least one feature which ext3 doesn't understand */