Skip to contentSkip to conversation

ulogd: fix build with musl

PATCH New Rahul Bedarkar 2 participants 2 messages Aug 17, 2016 – Aug 18, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ulogd: fix build with musl

Add upstream patches to fix build issue with musl.

Fixes:

http://autobuild.buildroot.net/results/c42/c42db6f8c89df87e9b55d6c7aaf6098d64d8ffdb/

---
 ...ev-null-as-dummy-logfile-when-logging-to-.patch |  70 ++
 ...fine-_GNU_SOURCE-to-get-members-of-tcphdr.patch |  44 ++
 .../ulogd/0003-Use-stdint-types-everywhere.patch   | 792 +++++++++++++++++++++
 3 files changed, 906 insertions(+)
 create mode 100644 package/ulogd/0001-ulogd-Use-dev-null-as-dummy-logfile-when-logging-to-.patch
 create mode 100644 package/ulogd/0002-Define-_GNU_SOURCE-to-get-members-of-tcphdr.patch
 create mode 100644 package/ulogd/0003-Use-stdint-types-everywhere.patch
package/ulogd/0001-ulogd-Use-dev-null-as-dummy-logfile-when-logging-to-.patch new file +70 -0
new file mode 100644
index 0000000..e6b51c8
@@ -0,0 +1,70 @@
+From 8a6ddd1cb2b55c234f1a97f7e5d996f24f46b6f8 Mon Sep 17 00:00:00 2001
+From: Felix Janda <[email protected]>
+Date: Sat, 16 May 2015 17:43:23 +0200
+Subject: [PATCH 1/1] ulogd: Use /dev/null as dummy logfile when logging to
+ syslog
+
+Fixes compilation error with musl libc:
+
+ulogd.c:86:13: error: storage size of 'syslog_dummy' isn't known
+ static FILE syslog_dummy;
+
+Signed-off-by: Felix Janda <[email protected]>
+[Rahul Bedarkar: Backported from https://git.netfilter.org/ulogd2/commit/?id=8a6ddd1cb2b55c234f1a97f7e5d996f24f46b6f8]
+Signed-off-by: Rahul Bedarkar <[email protected]>
+---
+ src/ulogd.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/ulogd.c b/src/ulogd.c
+index e7cde39..958c30a 100644
+--- a/src/ulogd.c
++++ b/src/ulogd.c
+@@ -83,7 +83,7 @@ static char *ulogd_logfile = NULL;
+ static const char *ulogd_configfile = ULOGD_CONFIGFILE;
+ static const char *ulogd_pidfile = NULL;
+ static int ulogd_pidfile_fd = -1;
+-static FILE syslog_dummy;
++static FILE *syslog_dummy;
+ 
+ static int info_mode = 0;
+ 
+@@ -427,7 +427,7 @@ void __ulogd_log(int level, char *file, int line, const char *format, ...)
+ 	if (level < loglevel_ce.u.value)
+ 		return;
+ 
+-	if (logfile == &syslog_dummy) {
++	if (logfile == syslog_dummy) {
+ 		/* FIXME: this omits the 'file' string */
+ 		va_start(ap, format);
+ 		vsyslog(ulogd2syslog_level(level), format, ap);
+@@ -950,7 +950,7 @@ static int logfile_open(const char *name)
+ 		logfile = stdout;
+ 	} else if (!strcmp(name, "syslog")) {
+ 		openlog("ulogd", LOG_PID, LOG_DAEMON);
+-		logfile = &syslog_dummy;
++		logfile = syslog_dummy = fopen("/dev/null", "w");
+ 	} else {
+ 		logfile = fopen(ulogd_logfile, "a");
+ 		if (!logfile) {
+@@ -1240,7 +1240,7 @@ static void sigterm_handler(int signal)
+ 	unload_plugins();
+ #endif
+ 
+-	if (logfile != NULL  && logfile != stdout && logfile != &syslog_dummy) {
++	if (logfile != NULL  && logfile != stdout) {
+ 		fclose(logfile);
+ 		logfile = NULL;
+ 	}
+@@ -1262,7 +1262,7 @@ static void signal_handler(int signal)
+ 	switch (signal) {
+ 	case SIGHUP:
+ 		/* reopen logfile */
+-		if (logfile != stdout && logfile != &syslog_dummy) {
++		if (logfile != stdout && logfile != syslog_dummy) {
+ 			fclose(logfile);
+ 			logfile = fopen(ulogd_logfile, "a");
+  			if (!logfile) {
+-- 
+2.6.2
+
package/ulogd/0002-Define-_GNU_SOURCE-to-get-members-of-tcphdr.patch new file +44 -0

44 lines not on this page · raw message

package/ulogd/0003-Use-stdint-types-everywhere.patch new file +792 -0

792 lines not on this page · raw message

Signature · 1 line
2.6.2
#1 lore raw

PATCH 1/1 ulogd: fix build with musl

Hello,

Quoted 7 lines · Rahul Bedarkar

Add upstream patches to fix build issue with musl.

Fixes:

http://autobuild.buildroot.net/results/c42/c42db6f8c89df87e9b55d6c7aaf6098d64d8ffdb/

Quoted 8 lines
---
 ...ev-null-as-dummy-logfile-when-logging-to-.patch |  70 ++
 ...fine-_GNU_SOURCE-to-get-members-of-tcphdr.patch |  44 ++
 .../ulogd/0003-Use-stdint-types-everywhere.patch   | 792 +++++++++++++++++++++
 3 files changed, 906 insertions(+)
 create mode 100644 package/ulogd/0001-ulogd-Use-dev-null-as-dummy-logfile-when-logging-to-.patch
 create mode 100644 package/ulogd/0002-Define-_GNU_SOURCE-to-get-members-of-tcphdr.patch
 create mode 100644 package/ulogd/0003-Use-stdint-types-everywhere.patch

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com