]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix some type comparison problems
authorXiao Ni <xni@redhat.com>
Sat, 6 Feb 2016 01:18:41 +0000 (09:18 +0800)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 8 Feb 2016 15:49:22 +0000 (10:49 -0500)
As 26714713cd2bad9e0bf7f4669f6cc4659ceaab6c said, 32 bit signed
timestamps will overflow in the year 2038. It already changed the
utime and ctime in struct mdu_array_info_s from int to unsigned
int. So we need to change the values that compared with them to
unsigned int too.

Signed-off-by : Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Monitor.c
util.c

index f19c2e58a5209728fc1af5447ec3dc5bacc63468..6df80f94978deba5de1e40e42900802e96b7f642 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -33,7 +33,7 @@
 struct state {
        char *devname;
        char devnm[32]; /* to sync with mdstat info */
-       long utime;
+       unsigned int utime;
        int err;
        char *spare_group;
        int active, working, failed, spare, raid;
diff --git a/util.c b/util.c
index 970d48476e86044843fe8769b4993af2423cc6d8..6e7d3fb93306bda2403e771a59e36cc689e89f52 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1267,7 +1267,7 @@ struct supertype *guess_super_type(int fd, enum guess_types guess_type)
         */
        struct superswitch  *ss;
        struct supertype *st;
-       time_t besttime = 0;
+       unsigned int besttime = 0;
        int bestsuper = -1;
        int i;