diff options
author | Thomas Haller <thaller@redhat.com> | 2016-03-08 17:41:31 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-03-08 17:57:20 +0100 |
commit | b36d7215255f2adb43341c15d438609d4087cc32 (patch) | |
tree | 93c703329adf232f7a983df981b34d79c50f1662 /src/nm-logging.c | |
parent | 24d96e6f65cf29c76b462c37362190c54a4c0698 (diff) | |
download | NetworkManager-b36d7215255f2adb43341c15d438609d4087cc32.tar.gz |
all: drop str_if_set() in favor of the "?:" operator
str_if_set() was added to replace the non-standard gcc extension "?:".
However, "?:" is supported by clang as well and we already use it at
several places.
Also, str_if_set() did not follow our naming scheme and renaming to
nm_str_if_set() would be ugly. So just drop it.
Diffstat (limited to 'src/nm-logging.c')
-rw-r--r-- | src/nm-logging.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nm-logging.c b/src/nm-logging.c index bb53c7a15f..16951764e0 100644 --- a/src/nm-logging.c +++ b/src/nm-logging.c @@ -725,11 +725,11 @@ nm_log_handler (const gchar *log_domain, boottime = nm_utils_monotonic_timestamp_as_boottime (now, 1); sd_journal_send ("PRIORITY=%d", syslog_priority, - "MESSAGE=%s", str_if_set (message, ""), + "MESSAGE=%s", message ?: "", "SYSLOG_IDENTIFIER=%s", G_LOG_DOMAIN, "SYSLOG_PID=%ld", (long) getpid (), "SYSLOG_FACILITY=GLIB", - "GLIB_DOMAIN=%s", str_if_set (log_domain, ""), + "GLIB_DOMAIN=%s", log_domain ?: "", "GLIB_LEVEL=%d", (int) (level & G_LOG_LEVEL_MASK), "TIMESTAMP_MONOTONIC=%lld.%06lld", (long long) (now / NM_UTILS_NS_PER_SECOND), (long long) ((now % NM_UTILS_NS_PER_SECOND) / 1000), "TIMESTAMP_BOOTTIME=%lld.%06lld", (long long) (boottime / NM_UTILS_NS_PER_SECOND), (long long) ((boottime % NM_UTILS_NS_PER_SECOND) / 1000), @@ -738,7 +738,7 @@ nm_log_handler (const gchar *log_domain, break; #endif default: - syslog (syslog_priority, "%s", str_if_set (message, "")); + syslog (syslog_priority, "%s", message ?: ""); break; } } |