summaryrefslogtreecommitdiffstats
path: root/package/sysklogd/0006-syslogd.c-rename-dprintf-to-mydprintf.patch
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2016-11-28 23:20:58 +0100
committerPeter Korsgaard <peter@korsgaard.com>2016-12-06 11:28:43 +0100
commit55b1114f7202ff09a1d060a112760b1e2efa477c (patch)
treefb963acfd837330b0af78a9e55d8094c5dfbf9f5 /package/sysklogd/0006-syslogd.c-rename-dprintf-to-mydprintf.patch
parent4c4756be6b34ccb20c4b879efddda5c291da52ca (diff)
downloadbuildroot-55b1114f7202ff09a1d060a112760b1e2efa477c.tar.gz
buildroot-55b1114f7202ff09a1d060a112760b1e2efa477c.zip
sysklogd: fix build on musl
This commit add a stack of small patches that make sysklogd build fine with the musl C library. Build with uClibc and glibc has been tested with those patches applied as well. The first patch is slightly rework (better description and capital letter to the title) in preparation for upstream submission. Fixes: http://autobuild.buildroot.net/results/8fa2bf73f983330884bce2e5ac31e01dee112ba9/ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/sysklogd/0006-syslogd.c-rename-dprintf-to-mydprintf.patch')
-rw-r--r--package/sysklogd/0006-syslogd.c-rename-dprintf-to-mydprintf.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/package/sysklogd/0006-syslogd.c-rename-dprintf-to-mydprintf.patch b/package/sysklogd/0006-syslogd.c-rename-dprintf-to-mydprintf.patch
new file mode 100644
index 0000000000..a1fb5331e4
--- /dev/null
+++ b/package/sysklogd/0006-syslogd.c-rename-dprintf-to-mydprintf.patch
@@ -0,0 +1,39 @@
+From 68213f6902d291d2ba1626fd950fd7d4a1329d33 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Mon, 28 Nov 2016 23:13:08 +0100
+Subject: [PATCH] syslogd.c: rename dprintf() to mydprintf()
+
+There is an existing kludge in syslogd.c to rename all dprintf()
+function calls and its definition to mydprintf(). This kludge is only
+applied when the glibc C library is used (i.e when GLIBC is defined),
+because glibc also provides a dprintf() function, with a different
+signature and behavior.
+
+However, the musl C library also provides the dprintf() function (with
+the same signature as the one in glibc, obviously), but does not define
+the GLIBC macro, causing a conflicting definition of dprintf.
+
+This commit fixes that by having the rename kludge used unconditionally.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ syslogd.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/syslogd.c b/syslogd.c
+index b5e8054..22a9ed5 100644
+--- a/syslogd.c
++++ b/syslogd.c
+@@ -818,9 +818,7 @@ void doexit(int sig);
+ void init();
+ void cfline(char *line, register struct filed *f);
+ int decode(char *name, struct code *codetab);
+-#if defined(__GLIBC__)
+ #define dprintf mydprintf
+-#endif /* __GLIBC__ */
+ static void dprintf(char *, ...);
+ static void allocate_log(void);
+ void sighup_handler();
+--
+2.7.4
+
OpenPOWER on IntegriCloud