aboutsummaryrefslogtreecommitdiff
path: root/util-linux/switch_root.c
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2008-05-13 02:27:31 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2008-05-13 02:27:31 +0000
commit77ad97f199f1bf05e9a7609bbdd239dab825b258 (patch)
treecf117ebf8d4a50bc7ba0e4da4d60a98a944756c8 /util-linux/switch_root.c
parentc4f12f59cc907577d787f816b37122809f896bb2 (diff)
downloadbusybox-77ad97f199f1bf05e9a7609bbdd239dab825b258.tar.gz
busybox-77ad97f199f1bf05e9a7609bbdd239dab825b258.tar.bz2
more -Wall warning fixes from Cristian Ionescu-Idbohrn.
This time it resulted in small code changes: function old new delta nexpr 820 828 +8 tail_main 1200 1202 +2 wrapf 166 167 +1 parse_mount_options 227 209 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 11/-18) Total: -7 bytes
Diffstat (limited to 'util-linux/switch_root.c')
-rw-r--r--util-linux/switch_root.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index c030b99e1..bae695b0b 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -13,15 +13,15 @@
// Make up for header deficiencies.
#ifndef RAMFS_MAGIC
-#define RAMFS_MAGIC 0x858458f6
+#define RAMFS_MAGIC ((unsigned)0x858458f6)
#endif
#ifndef TMPFS_MAGIC
-#define TMPFS_MAGIC 0x01021994
+#define TMPFS_MAGIC ((unsigned)0x01021994)
#endif
#ifndef MS_MOVE
-#define MS_MOVE 8192
+#define MS_MOVE 8192
#endif
static dev_t rootdev;
@@ -91,10 +91,10 @@ int switch_root_main(int argc ATTRIBUTE_UNUSED, char **argv)
// we mean it. (I could make this a CONFIG option, but I would get email
// from all the people who WILL eat their filesystems.)
- if (lstat("/init", &st1) || !S_ISREG(st1.st_mode) || statfs("/", &stfs) ||
- (stfs.f_type != RAMFS_MAGIC && stfs.f_type != TMPFS_MAGIC) ||
- getpid() != 1)
- {
+ if (lstat("/init", &st1) || !S_ISREG(st1.st_mode) || statfs("/", &stfs)
+ || (((unsigned)stfs.f_type != RAMFS_MAGIC) && ((unsigned)stfs.f_type != TMPFS_MAGIC))
+ || (getpid() != 1)
+ ) {
bb_error_msg_and_die("not rootfs");
}