summaryrefslogtreecommitdiff
path: root/package/ulogd/patches/patch-src_ulogd_c
blob: dd24023ce4e54b899b0aa50e8123a18dbb35be4c (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
--- ulogd-2.0.2.orig/src/ulogd.c	2013-03-01 16:45:23.285968838 +0100
+++ ulogd-2.0.2/src/ulogd.c	2013-08-20 19:09:53.029031721 +0200
@@ -78,7 +78,7 @@
 static FILE *logfile = NULL;		/* logfile pointer */
 static char *ulogd_logfile = NULL;
 static const char *ulogd_configfile = ULOGD_CONFIGFILE;
-static FILE syslog_dummy;
+static FILE *syslog_dummy = NULL;
 
 static int info_mode = 0;
 
@@ -420,7 +420,7 @@ void __ulogd_log(int level, char *file,
 	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);
@@ -941,7 +941,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;
 	} else {
 		logfile = fopen(ulogd_logfile, "a");
 		if (!logfile) {
@@ -1070,7 +1070,7 @@ static void sigterm_handler(int signal)
 	unload_plugins();
 #endif
 
-	if (logfile != NULL  && logfile != stdout && logfile != &syslog_dummy) {
+	if (logfile != NULL  && logfile != stdout && logfile != syslog_dummy) {
 		fclose(logfile);
 		logfile = NULL;
 	}
@@ -1090,7 +1090,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) {