From b34bc9de1573d92171e8237bad71c5b9d403d359 Mon Sep 17 00:00:00 2001 From: "Maxin B. John" Date: Fri, 5 Feb 2016 17:14:04 +0200 Subject: [PATCH 1/3] util.c: include poll.h instead of sys/poll.h This fixes a compile warning when building with musl: In file included from util.c:27:0: | qemux86-64/usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include to [-Werror=cpp] | #warning redirecting incorrect #include to | ^ Signed-off-by: Maxin B. John --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From cf14a9987ea1040457ce53bc2ab7d096818cb780 Mon Sep 17 00:00:00 2001 From: "Maxin B. John" Date: Fri, 5 Feb 2016 18:06:32 +0200 Subject: [PATCH 2/3] mdadm.h: bswap is already defined in uclibc Fixes this build error: | In file included from mdadm.c:28:0: | mdadm.h:142:0: error: "bswap_16" redefined [-Werror] | #define bswap_16(x) (((x) & 0x00ffU) << 8 | \ | ^ Signed-off-by: Maxin B. John --- mdadm.h | 9 +++++++++ 1 file changed, 9 insertions(+) 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 From 29d6fb20b77069cc7c0239be6ed263d107f9f0ed Mon Sep 17 00:00:00 2001 From: "Maxin B. John" Date: Fri, 5 Feb 2016 18:50:21 +0200 Subject: [PATCH 3/3] Monitor.c: fix compiler error with x32 toolchain With x32 toolchain, this code caused the below listed error: | Monitor.c: In function 'check_array': | Monitor.c:545:16: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] | if (st->utime == array.utime && Signed-off-by: Maxin B. John --- Monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 &&