patch-src_ulogd_c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- ulogd-2.0.2.orig/src/ulogd.c 2013-03-01 16:45:23.000000000 +0100
  2. +++ ulogd-2.0.2/src/ulogd.c 2013-11-11 21:27:31.000000000 +0100
  3. @@ -78,7 +78,7 @@
  4. static FILE *logfile = NULL; /* logfile pointer */
  5. static char *ulogd_logfile = NULL;
  6. static const char *ulogd_configfile = ULOGD_CONFIGFILE;
  7. -static FILE syslog_dummy;
  8. +static FILE *syslog_dummy;
  9. static int info_mode = 0;
  10. @@ -420,7 +420,7 @@ void __ulogd_log(int level, char *file,
  11. if (level < loglevel_ce.u.value)
  12. return;
  13. - if (logfile == &syslog_dummy) {
  14. + if (logfile == syslog_dummy) {
  15. /* FIXME: this omits the 'file' string */
  16. va_start(ap, format);
  17. vsyslog(ulogd2syslog_level(level), format, ap);
  18. @@ -941,7 +941,7 @@ static int logfile_open(const char *name
  19. logfile = stdout;
  20. } else if (!strcmp(name, "syslog")) {
  21. openlog("ulogd", LOG_PID, LOG_DAEMON);
  22. - logfile = &syslog_dummy;
  23. + logfile = syslog_dummy;
  24. } else {
  25. logfile = fopen(ulogd_logfile, "a");
  26. if (!logfile) {
  27. @@ -1070,7 +1070,7 @@ static void sigterm_handler(int signal)
  28. unload_plugins();
  29. #endif
  30. - if (logfile != NULL && logfile != stdout && logfile != &syslog_dummy) {
  31. + if (logfile != NULL && logfile != stdout && logfile != syslog_dummy) {
  32. fclose(logfile);
  33. logfile = NULL;
  34. }
  35. @@ -1090,7 +1090,7 @@ static void signal_handler(int signal)
  36. switch (signal) {
  37. case SIGHUP:
  38. /* reopen logfile */
  39. - if (logfile != stdout && logfile != &syslog_dummy) {
  40. + if (logfile != stdout && logfile != syslog_dummy) {
  41. fclose(logfile);
  42. logfile = fopen(ulogd_logfile, "a");
  43. if (!logfile) {