samhain: fix build issues when using musl

[v2]: Correct musl malloc fix.
remove HAVE_MALLOC_H define; this enables using the included defined mallinfo.

[V1]: Fix c99

x_dnmalloc.c:563:26: error: return type is an incomplete type
| #define public_mALLINFo mallinfo
| ^
| x_dnmalloc.c:1689:17: note: in expansion of macro 'public_mALLINFo'
| struct mallinfo public_mALLINFo() {

and
_dnmalloc.c:5527:17: error: unknown type name 'u_int'
| u_int rnd[(128 - 2*sizeof(struct timeval)) / sizeof(u_int)];
| ^~~~~

Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
Armin Kuster
2017-03-15 16:57:20 -07:00
parent 4c4fa8c503
commit e16ae4d080
2 changed files with 23 additions and 0 deletions
@@ -0,0 +1,18 @@
samhain: musl build fix c99
Upstream-Status: Submitted
Signed-off-by: Armin Kuster <akuster@mvista.com>
Index: samhain-4.2.0/src/dnmalloc.c
===================================================================
--- samhain-4.2.0.orig/src/dnmalloc.c
+++ samhain-4.2.0/src/dnmalloc.c
@@ -5524,7 +5524,7 @@ arc4_stir(void)
struct {
struct timeval tv1;
struct timeval tv2;
- u_int rnd[(128 - 2*sizeof(struct timeval)) / sizeof(u_int)];
+ unsigned char rnd[(128 - 2*sizeof(struct timeval)) / sizeof(unsigned char)];
} rdat;
#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
ssize_t sz = 0;
+5
View File
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=8ca43cbc842c2336e835926c2166c28b"
SRC_URI = "http://la-samhna.de/archive/samhain_signed-${PV}.tar.gz \
file://${INITSCRIPT_NAME}.init \
file://${INITSCRIPT_NAME}.default \
file://c99_dnmalloc.patch \
"
SRC_URI[md5sum] = "d98a55646b14f9419fcedde909d1bf02"
@@ -75,6 +76,10 @@ do_configure () {
${EXTRA_OECONF}
}
do_compile_prepend_libc-musl () {
sed -i 's/^#define HAVE_MALLOC_H.*//' ${B}/config.h
}
# Install the init script, it's default file, and the extraneous
# documentation.
do_install_append () {