]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
apmd: Fix build with musl
authorKhem Raj <raj.khem@gmail.com>
Sun, 10 Jan 2016 03:42:19 +0000 (19:42 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 22 Jan 2016 23:42:52 +0000 (23:42 +0000)
Fix error like below
| apmd.c:372:41: error: use of undeclared identifier '__WCOREFLAG'
|                                 status = __W_EXITCODE(0, SIGTERM) | __WCOREFLAG;
|                                                                     ^
| apmd.c:392:41: error: use of undeclared identifier '__WCOREFLAG'
|                                 status = __W_EXITCODE(0, SIGTERM) | __WCOREFLAG;

Signed-off-by: Khem Raj <raj.khem@gmail.com>
meta/recipes-bsp/apmd/apmd/wexitcode.patch [new file with mode: 0644]
meta/recipes-bsp/apmd/apmd_3.2.2-15.bb

diff --git a/meta/recipes-bsp/apmd/apmd/wexitcode.patch b/meta/recipes-bsp/apmd/apmd/wexitcode.patch
new file mode 100644 (file)
index 0000000..c5faa85
--- /dev/null
@@ -0,0 +1,26 @@
+Define non-posix W* funcitons
+
+C libraries like musl dont define them
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: apmd-3.2.2.orig/apmd.c
+===================================================================
+--- apmd-3.2.2.orig.orig/apmd.c
++++ apmd-3.2.2.orig/apmd.c
+@@ -55,6 +55,14 @@
+ #define MINIMUM_RATE_CALC_TIME  120
+ #endif
++#ifndef _POSIX_SOURCE
++
++#define       __WCOREFLAG  0200
++#define __WCOREDUMP(x)  (_W_INT(x) & __WCOREFLAG)
++#define       __W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
++
++#endif
++
+ /*
+  * For the verbosity level feature to be useful,
+  * we rely on the fact that syslog.h assigns adjacent
index 9492c6994eb97b4fde68e744cb5d7031427105a1..a932375205b5fd244d923396f19077088cdce090 100644 (file)
@@ -13,6 +13,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_3.2.2.orig.tar.gz;name=tarball \
            file://legacy.patch \
            file://libtool.patch \
            file://unlinux.patch \
+           file://wexitcode.patch \
            file://init \
            file://default \
            file://apmd_proxy \