about summary refs log tree commit diff
path: root/src/nm-dbus-manager.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-10-20 01:31:18 +0200
committerMichael Biebl <biebl@debian.org>2018-10-20 01:31:18 +0200
commitb4885f208ba690090952c0ae0452dd5bc2ba0601 (patch)
tree5c8af02da4543f7132b9bad45711a3a65e620d0d /src/nm-dbus-manager.c
parent142485af41b7cf7b0060cc682a56d3ff38cabbb6 (diff)
parent6518e361171f64bcaaa4bf868139362ed95cc2e0 (diff)
Update upstream source from tag 'upstream/1.14.2'
Update to upstream version '1.14.2'
with Debian dir c118292f450ace1133a5dba2777cbeb54977dbe8
Diffstat (limited to 'src/nm-dbus-manager.c')
-rw-r--r--src/nm-dbus-manager.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c
index 0a421aa9..ca7bde57 100644
--- a/src/nm-dbus-manager.c
+++ b/src/nm-dbus-manager.c
@@ -1480,7 +1480,11 @@ nm_dbus_manager_start (NMDBusManager *self,
 
 	g_return_if_fail (NM_IS_DBUS_MANAGER (self));
 	priv = NM_DBUS_MANAGER_GET_PRIVATE (self);
-	g_return_if_fail (priv->connection);
+
+	if (!priv->connection) {
+		/* Do nothing. We're presumably in the configure-and-quit mode. */
+		return;
+	}
 
 	priv->set_property_handler = set_property_handler;
 	priv->set_property_handler_data = set_property_handler_data;
@@ -1505,29 +1509,17 @@ nm_dbus_manager_acquire_bus (NMDBusManager *self)
 
 	priv = NM_DBUS_MANAGER_GET_PRIVATE (self);
 
-	/* we will create the D-Bus connection and registering the name synchronously.
-	 * The reason why that is necessary is because:
-	 *  (1) if we are unable to create a D-Bus connection, it means D-Bus is not
-	 *    available and we run in D-Bus less mode. We do not support creating
-	 *    a D-Bus connection later on. This disconnected mode is useful for initrd
-	 *    (well, currently not yet, but will be).
-	 *  (2) if we are able to create the connection and register the name,
-	 *    all is good and we run with D-Bus. Note that D-Bus disconnects
-	 *    from D-Bus are ignored. Essentially, we do not support restarting
-	 *    D-Bus.
-	 *  (3) if we are able to create the connection but registration fails,
-	 *    it means that something is borked. Quite possibly another NetworkManager
-	 *    instance is running. We need to exit right away.
-	 * To appease (1) and (3), we cannot initalize synchronously, because we need
-	 * to know right away whether another NetworkManager instance is running (3).
-	 **/
-
+	/* Create the D-Bus connection and registering the name synchronously.
+	 * That is necessary because we need to exit right away if we can't
+	 * acquire the name despite connecting to the bus successfully.
+	 * It means that something is gravely broken -- such as another NetworkManager
+	 * instance running. */
 	connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM,
 	                             NULL,
 	                             &error);
 	if (!connection) {
-		_LOGI ("cannot connect to D-Bus and proceed without (%s)", error->message);
-		return TRUE;
+		_LOGI ("cannot connect to D-Bus: %s", error->message);
+		return FALSE;
 	}
 
 	g_dbus_connection_set_exit_on_close (connection, FALSE);