summaryrefslogtreecommitdiff
path: root/src/nm-logging.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm-logging.c')
-rw-r--r--src/nm-logging.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nm-logging.c b/src/nm-logging.c
index 60ccb5cb2f..159d83fcf9 100644
--- a/src/nm-logging.c
+++ b/src/nm-logging.c
@@ -149,8 +149,14 @@ static char *_domains_to_string (gboolean include_level_override);
static void
_ensure_initialized (void)
{
- if (G_UNLIKELY (!global.logging_set_up))
+ if (G_UNLIKELY (!global.logging_set_up)) {
+ int errsv = errno;
+
nm_logging_setup ("INFO", LOGD_DEFAULT_STRING, NULL, NULL);
+
+ /* must ensure that errno is not modified. */
+ errno = errsv;
+ }
}
static gboolean
@@ -419,6 +425,7 @@ nm_logging_enabled (NMLogLevel level, NMLogDomain domain)
if ((guint) level >= G_N_ELEMENTS (global.logging))
g_return_val_if_reached (FALSE);
+ /* This function is guaranteed not to modify errno. */
_ensure_initialized ();
return !!(global.logging[level] & domain);