diff --git a/Monitor.c b/Monitor.c index f19c2e58..748d61b2 100644 --- a/Monitor.c +++ b/Monitor.c @@ -542,7 +542,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat, alert("NewArray", st->devname, NULL, ainfo); } - if (st->utime == array.utime && + if ((unsigned long)st->utime == array.utime && st->failed == array.failed_disks && st->working == array.working_disks && st->spare == array.spare_disks && diff --git a/mdadm.h b/mdadm.h index dd02be71..230e60f2 100755 --- a/mdadm.h +++ b/mdadm.h @@ -139,12 +139,20 @@ struct dlm_lksb { * and there is no standard conversion function so... */ /* And dietlibc doesn't think byteswap is ok, so.. */ /* #include */ + +#ifndef bswap_16 #define bswap_16(x) (((x) & 0x00ffU) << 8 | \ ((x) & 0xff00U) >> 8) +#endif + +#ifndef bswap_32 #define bswap_32(x) (((x) & 0x000000ffU) << 24 | \ ((x) & 0xff000000U) >> 24 | \ ((x) & 0x0000ff00U) << 8 | \ ((x) & 0x00ff0000U) >> 8) +#endif + +#ifndef bswap_64 #define bswap_64(x) (((x) & 0x00000000000000ffULL) << 56 | \ ((x) & 0xff00000000000000ULL) >> 56 | \ ((x) & 0x000000000000ff00ULL) << 40 | \ @@ -153,6 +161,7 @@ struct dlm_lksb { ((x) & 0x0000ff0000000000ULL) >> 24 | \ ((x) & 0x00000000ff000000ULL) << 8 | \ ((x) & 0x000000ff00000000ULL) >> 8) +#endif #if !defined(__KLIBC__) #if BYTE_ORDER == LITTLE_ENDIAN diff --git a/util.c b/util.c index 970d4847..3e6d2937 100644 --- a/util.c +++ b/util.c @@ -24,7 +24,6 @@ #include "mdadm.h" #include "md_p.h" -#include #include #include #include @@ -32,6 +31,7 @@ #include #include #include +#include #include #include #include