aboutsummaryrefslogtreecommitdiffstats
path: root/main/ulogd/musl-fixes.patch
blob: 1b23de7dfe8627a7d3335e0bb7f2b00ad510be3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--- ulogd-2.0.3.orig/filter/raw2packet/ulogd_raw2packet_BASE.c
+++ ulogd-2.0.3/filter/raw2packet/ulogd_raw2packet_BASE.c
@@ -43,6 +43,7 @@
 #include <ulogd/ipfix_protocol.h>
 #include <netinet/if_ether.h>
 #include <string.h>
+#include <linux/types.h>
 
 enum input_keys {
 	INKEY_RAW_PCKT,
--- ulogd-2.0.3.orig/src/ulogd.c
+++ ulogd-2.0.3/src/ulogd.c
@@ -78,12 +78,12 @@
 	"(C) 2008-2012 Eric Leblond <eric@regit.org>\n"
 
 /* global variables */
+static int log_to_syslog = 0;
 static FILE *logfile = NULL;		/* logfile pointer */
 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 int info_mode = 0;
 
@@ -427,7 +427,7 @@
 	if (level < loglevel_ce.u.value)
 		return;
 
-	if (logfile == &syslog_dummy) {
+	if (log_to_syslog) {
 		/* FIXME: this omits the 'file' string */
 		va_start(ap, format);
 		vsyslog(ulogd2syslog_level(level), format, ap);
@@ -950,7 +950,7 @@
 		logfile = stdout;
 	} else if (!strcmp(name, "syslog")) {
 		openlog("ulogd", LOG_PID, LOG_DAEMON);
-		logfile = &syslog_dummy;
+		log_to_syslog = 1;
 	} else {
 		logfile = fopen(ulogd_logfile, "a");
 		if (!logfile) {
@@ -1240,7 +1240,7 @@
 	unload_plugins();
 #endif
 
-	if (logfile != NULL  && logfile != stdout && logfile != &syslog_dummy) {
+	if (logfile != NULL  && logfile != stdout) {
 		fclose(logfile);
 		logfile = NULL;
 	}
@@ -1262,7 +1262,7 @@
 	switch (signal) {
 	case SIGHUP:
 		/* reopen logfile */
-		if (logfile != stdout && logfile != &syslog_dummy) {
+		if (logfile != stdout && logfile != NULL) {
 			fclose(logfile);
 			logfile = fopen(ulogd_logfile, "a");
  			if (!logfile) {