core: suppress logging warning when trying to create existing directory

Suppress logging the following line:
  <warn> Error creating directory "/var/run/NetworkManager": 17 (File exists)

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2013-12-04 17:12:43 +01:00
parent b7d6c61fe7
commit c0e09de2b7

View file

@ -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);