[PATCH] log: fix WITH_SYSTEMD_JOURNAL guards

Ben Chan benchan at chromium.org
Thu Jun 22 06:53:17 UTC 2017


Commit fd0bed1df ("log: Add support for journal logging") added a
configure option --with-systemd-journal to enable journal logging.
However, configure always defines WITH_SYSTEMD_JOURNAL, which is either
0 or 1. Thus, `#if WITH_SYSTEMD_JOURNAL` should be used instead of
`#if defined WITH_SYSTEMD_JOURNAL` to properly guard the journal logging
code.
---
 src/mm-log.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mm-log.c b/src/mm-log.c
index 5691b26f..8b1fa425 100644
--- a/src/mm-log.c
+++ b/src/mm-log.c
@@ -35,7 +35,7 @@
 #include <libmbim-glib.h>
 #endif
 
-#if defined WITH_SYSTEMD_JOURNAL
+#if WITH_SYSTEMD_JOURNAL
 #define SD_JOURNAL_SUPPRESS_LOCATION
 #include <systemd/sd-journal.h>
 #endif
@@ -153,7 +153,7 @@ log_backend_syslog (const char *loc,
     syslog (syslog_level, "%s", message);
 }
 
-#if defined WITH_SYSTEMD_JOURNAL
+#if WITH_SYSTEMD_JOURNAL
 static void
 log_backend_systemd_journal (const char *loc,
                              const char *func,
@@ -301,7 +301,7 @@ mm_log_setup (const char *level,
     /* Grab start time for relative timestamps */
     g_get_current_time (&rel_start);
 
-#if defined WITH_SYSTEMD_JOURNAL
+#if WITH_SYSTEMD_JOURNAL
     if (log_journal) {
         log_backend = log_backend_systemd_journal;
         append_log_level_text = FALSE;
-- 
2.13.1.611.g7e3b11ae1-goog



More information about the ModemManager-devel mailing list