dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone
Blob Blame History Raw
From 7ac5d47e8ab465cb2321eaceb3a0f62748312ffe Mon Sep 17 00:00:00 2001
From: "mwilck@arcor.de" <mwilck@arcor.de>
Date: Fri, 16 Aug 2013 20:21:59 +0200
Subject: [PATCH] in_initrd: fix gcc compiler error

On some systems, this code caused a "comparison between signed
and unsigned" error.

Signed-off-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>
---
 util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util.c b/util.c
index 8096e29..491a107 100644
--- a/util.c
+++ b/util.c
@@ -1949,6 +1949,6 @@ int in_initrd(void)
 	/* This is based on similar function in systemd. */
 	struct statfs s;
 	return  statfs("/", &s) >= 0 &&
-		(s.f_type == TMPFS_MAGIC ||
-		 s.f_type == RAMFS_MAGIC);
+		((unsigned long)s.f_type == TMPFS_MAGIC ||
+		 (unsigned long)s.f_type == RAMFS_MAGIC);
 }
-- 
1.8.4.2