kumquat-buildroot/package/sysklogd/0006-syslogd.c-rename-dprintf-to-mydprintf.patch
Thomas Petazzoni 55b1114f72 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>
2016-12-06 11:28:43 +01:00

40 lines
1.3 KiB
Diff

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