lede-packages-rs

git clone git://archive.git.mtrnord.blog/MTRNord/lede-packages-rs.git
Log | Files | Refs | README | LICENSE

100-musl-compat.patch (1728B)


      1 --- a/src/ulogd.c
      2 +++ b/src/ulogd.c
      3 @@ -83,7 +83,7 @@ static char *ulogd_logfile = NULL;
      4  static const char *ulogd_configfile = ULOGD_CONFIGFILE;
      5  static const char *ulogd_pidfile = NULL;
      6  static int ulogd_pidfile_fd = -1;
      7 -static FILE syslog_dummy;
      8 +static int ulogd_use_syslog = 0;
      9  
     10  static int info_mode = 0;
     11  
     12 @@ -427,7 +427,7 @@ void __ulogd_log(int level, char *file,
     13  	if (level < loglevel_ce.u.value)
     14  		return;
     15  
     16 -	if (logfile == &syslog_dummy) {
     17 +	if (ulogd_use_syslog) {
     18  		/* FIXME: this omits the 'file' string */
     19  		va_start(ap, format);
     20  		vsyslog(ulogd2syslog_level(level), format, ap);
     21 @@ -950,7 +950,7 @@ static int logfile_open(const char *name
     22  		logfile = stdout;
     23  	} else if (!strcmp(name, "syslog")) {
     24  		openlog("ulogd", LOG_PID, LOG_DAEMON);
     25 -		logfile = &syslog_dummy;
     26 +		ulogd_use_syslog = 1;
     27  	} else {
     28  		logfile = fopen(ulogd_logfile, "a");
     29  		if (!logfile) {
     30 @@ -1240,7 +1240,7 @@ static void sigterm_handler(int signal)
     31  	unload_plugins();
     32  #endif
     33  
     34 -	if (logfile != NULL  && logfile != stdout && logfile != &syslog_dummy) {
     35 +	if (logfile != NULL  && logfile != stdout) {
     36  		fclose(logfile);
     37  		logfile = NULL;
     38  	}
     39 @@ -1262,7 +1262,7 @@ static void signal_handler(int signal)
     40  	switch (signal) {
     41  	case SIGHUP:
     42  		/* reopen logfile */
     43 -		if (logfile != stdout && logfile != &syslog_dummy) {
     44 +		if (logfile != NULL && logfile != stdout) {
     45  			fclose(logfile);
     46  			logfile = fopen(ulogd_logfile, "a");
     47   			if (!logfile) {
     48 --- a/filter/raw2packet/ulogd_raw2packet_BASE.c
     49 +++ b/filter/raw2packet/ulogd_raw2packet_BASE.c
     50 @@ -42,6 +42,7 @@
     51  #include <ulogd/ulogd.h>
     52  #include <ulogd/ipfix_protocol.h>
     53  #include <netinet/if_ether.h>
     54 +#include <linux/types.h>
     55  #include <string.h>
     56  
     57  enum input_keys {