summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-01-13 19:48:47 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-24 09:40:31 +0000
commit6296c0f9ab1f73b28de726a297a42e7c7e3f26aa (patch)
tree484078705ce7ebb6e27468118f20d3cf76b3d5b8
parent67eef116d5810d171b9d5c63669671cc73eaeb8b (diff)
downloadpoky-6296c0f9ab1f73b28de726a297a42e7c7e3f26aa.tar.gz
mdadm: Fix build with musl
Define _POSIX_C_SOURCE if not defined Add sockaddr_un* to sockaddr* typecast to make compiler happy (From OE-Core rev: cdb858caadd81d3bdc9ea3fd596e3eab84ec2d81) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/mdadm/files/0001-Define-_POSIX_C_SOURCE-if-undefined.patch59
-rw-r--r--meta/recipes-extended/mdadm/mdadm_3.3.4.bb2
2 files changed, 60 insertions, 1 deletions
diff --git a/meta/recipes-extended/mdadm/files/0001-Define-_POSIX_C_SOURCE-if-undefined.patch b/meta/recipes-extended/mdadm/files/0001-Define-_POSIX_C_SOURCE-if-undefined.patch
new file mode 100644
index 0000000000..a461b763c9
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/0001-Define-_POSIX_C_SOURCE-if-undefined.patch
@@ -0,0 +1,59 @@
1From d74b02d4653d1ea26029c2528eb93d7268b83eb3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 13 Jan 2016 07:28:33 +0000
4Subject: [PATCH] Define _POSIX_C_SOURCE if undefined
5
6typecast second argument of connect() API to use struct sockaddr*
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10Upstream-Status: Pending
11
12 config.c | 3 +++
13 mdmon.c | 2 +-
14 msg.c | 2 +-
15 3 files changed, 5 insertions(+), 2 deletions(-)
16
17diff --git a/config.c b/config.c
18index a882ed3..a675688 100644
19--- a/config.c
20+++ b/config.c
21@@ -63,6 +63,9 @@
22 * but may not wrap over lines
23 *
24 */
25+#ifndef _POSIX_C_SOURCE
26+#define _POSIX_C_SOURCE 200809L
27+#endif
28
29 #ifndef CONFFILE
30 #define CONFFILE "/etc/mdadm.conf"
31diff --git a/mdmon.c b/mdmon.c
32index ee12b7c..e4b73d9 100644
33--- a/mdmon.c
34+++ b/mdmon.c
35@@ -235,7 +235,7 @@ static int make_control_sock(char *devname)
36 addr.sun_family = PF_LOCAL;
37 strcpy(addr.sun_path, path);
38 umask(077); /* ensure no world write access */
39- if (bind(sfd, &addr, sizeof(addr)) < 0) {
40+ if (bind(sfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
41 close(sfd);
42 return -1;
43 }
44diff --git a/msg.c b/msg.c
45index 754630b..45cd450 100644
46--- a/msg.c
47+++ b/msg.c
48@@ -170,7 +170,7 @@ int connect_monitor(char *devname)
49
50 addr.sun_family = PF_LOCAL;
51 strcpy(addr.sun_path, path);
52- if (connect(sfd, &addr, sizeof(addr)) < 0) {
53+ if (connect(sfd, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
54 close(sfd);
55 return -1;
56 }
57--
582.7.0
59
diff --git a/meta/recipes-extended/mdadm/mdadm_3.3.4.bb b/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
index 099361181e..e004030f85 100644
--- a/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
+++ b/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
@@ -14,13 +14,13 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
14 file://mdadm-3.3.2_x32_abi_time_t.patch \ 14 file://mdadm-3.3.2_x32_abi_time_t.patch \
15 file://0001-Fix-typo-in-comparision.patch \ 15 file://0001-Fix-typo-in-comparision.patch \
16 file://mdadm-fix-ptest-build-errors.patch \ 16 file://mdadm-fix-ptest-build-errors.patch \
17 file://0001-Define-_POSIX_C_SOURCE-if-undefined.patch \
17 file://run-ptest \ 18 file://run-ptest \
18 " 19 "
19SRC_URI[md5sum] = "7ca8b114710f98f53f20c5787b674a09" 20SRC_URI[md5sum] = "7ca8b114710f98f53f20c5787b674a09"
20SRC_URI[sha256sum] = "8ae5f45306b873190e91f410709b00e51997b633c072b33f8efd9f7df022ca68" 21SRC_URI[sha256sum] = "8ae5f45306b873190e91f410709b00e51997b633c072b33f8efd9f7df022ca68"
21 22
22CFLAGS += "-fno-strict-aliasing" 23CFLAGS += "-fno-strict-aliasing"
23
24inherit autotools-brokensep 24inherit autotools-brokensep
25 25
26EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"' 26EXTRA_OEMAKE = 'CHECK_RUN_DIR=0 CXFLAGS="${CFLAGS}"'