From c0e09de2b71299ea0fa54244107c24da6e8236cf Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 4 Dec 2013 17:12:43 +0100 Subject: [PATCH] core: suppress logging warning when trying to create existing directory Suppress logging the following line: Error creating directory "/var/run/NetworkManager": 17 (File exists) Signed-off-by: Thomas Haller --- src/nm-dbus-manager.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c index b1aa61be6d..2702faaba0 100644 --- a/src/nm-dbus-manager.c +++ b/src/nm-dbus-manager.c @@ -477,8 +477,10 @@ nm_dbus_manager_init (NMDBusManager *self) #if HAVE_DBUS_GLIB_100 /* Set up our main private DBus socket */ - if (mkdir (NMRUNDIR, 0700) == -1) - nm_log_warn (LOGD_CORE, "Error creating directory \"%s\": %d (%s)", NMRUNDIR, errno, g_strerror (errno)); + if (mkdir (NMRUNDIR, 0700) == -1) { + if (errno != EEXIST) + nm_log_warn (LOGD_CORE, "Error creating directory \"%s\": %d (%s)", NMRUNDIR, errno, g_strerror (errno)); + } priv->priv_server = private_server_new (PRIV_SOCK_PATH, PRIV_SOCK_TAG, self); if (priv->priv_server) { priv->private_servers = g_slist_append (priv->private_servers, priv->priv_server);