summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/statfs_magic.h4
-rw-r--r--sys-utils/switch_root.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/statfs_magic.h b/include/statfs_magic.h
index d27be1cff..7397a4e5d 100644
--- a/include/statfs_magic.h
+++ b/include/statfs_magic.h
@@ -7,9 +7,9 @@
* If possible then don't depend on internal libc __SWORD_TYPE type.
*/
#ifdef __GNUC__
-typedef __typeof__( ((struct statfs *)0)->f_type ) ul_statfs_ftype_t;
+#define F_TYPE_EQUAL(a, b) (a == (__typeof__(a)) b)
#else
-typedef __SWORD_TYPE ul_statfs_ftype_t;
+#define F_TYPE_EQUAL(a, b) (a == (__SWORD_TYPE) b)
#endif
/*
diff --git a/sys-utils/switch_root.c b/sys-utils/switch_root.c
index c6a2eff8e..534d44ac7 100644
--- a/sys-utils/switch_root.c
+++ b/sys-utils/switch_root.c
@@ -181,8 +181,8 @@ static int switchroot(const char *newroot)
if (pid <= 0) {
struct statfs stfs;
if (fstatfs(cfd, &stfs) == 0 &&
- (stfs.f_type == (ul_statfs_ftype_t) STATFS_RAMFS_MAGIC ||
- stfs.f_type == (ul_statfs_ftype_t) STATFS_TMPFS_MAGIC))
+ (F_TYPE_EQUAL(stfs.f_type, STATFS_RAMFS_MAGIC) ||
+ F_TYPE_EQUAL(stfs.f_type, STATFS_TMPFS_MAGIC)))
recursiveRemove(cfd);
else
warn(_("old root filesystem is not an initramfs"));