dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/mdadm-3.4.1-fix-some-type-comparison.patch

7bdf8f
commit 1d13b599607e48446273913ce594931ba53df9fd
7bdf8f
Author: Xiao Ni <xni@redhat.com>
7bdf8f
Date:   Sat Feb 6 09:18:41 2016 +0800
7bdf8f
7bdf8f
    Fix some type comparison problems
7bdf8f
    
7bdf8f
    As 26714713cd2bad9e0bf7f4669f6cc4659ceaab6c said, 32 bit signed
7bdf8f
    timestamps will overflow in the year 2038. It already changed the
7bdf8f
    utime and ctime in struct mdu_array_info_s from int to unsigned
7bdf8f
    int. So we need to change the values that compared with them to
7bdf8f
    unsigned int too.
7bdf8f
    
7bdf8f
    Signed-off-by : Xiao Ni <xni@redhat.com>
7bdf8f
    Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
7bdf8f
7bdf8f
diff --git a/Monitor.c b/Monitor.c
7bdf8f
index f19c2e5..6df80f9 100644
7bdf8f
--- a/Monitor.c
7bdf8f
+++ b/Monitor.c
7bdf8f
@@ -33,7 +33,7 @@
7bdf8f
 struct state {
7bdf8f
 	char *devname;
7bdf8f
 	char devnm[32];	/* to sync with mdstat info */
7bdf8f
-	long utime;
7bdf8f
+	unsigned int utime;
7bdf8f
 	int err;
7bdf8f
 	char *spare_group;
7bdf8f
 	int active, working, failed, spare, raid;
7bdf8f
diff --git a/util.c b/util.c
7bdf8f
index 970d484..6e7d3fb 100644
7bdf8f
--- a/util.c
7bdf8f
+++ b/util.c
7bdf8f
@@ -1267,7 +1267,7 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)
7bdf8f
 	 */
7bdf8f
 	struct superswitch  *ss;
7bdf8f
 	struct supertype *st;
7bdf8f
-	time_t besttime = 0;
7bdf8f
+	unsigned int besttime = 0;
7bdf8f
 	int bestsuper = -1;
7bdf8f
 	int i;
7bdf8f