+ else if (strcmp (method, "systemd") == 0)
+ {
+ int i, n, *fds;
+ DBusString address;
+
+ n = _dbus_listen_systemd_sockets (&fds, error);
+ if (n < 0)
+ {
+ _DBUS_ASSERT_ERROR_IS_SET (error);
+ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
+ }
+
+ if (!_dbus_string_init (&address))
+ goto systemd_oom;
+
+ for (i = 0; i < n; i++)
+ {
+ if (i > 0)
+ {
+ if (!_dbus_string_append (&address, ";"))
+ goto systemd_oom;
+ }
+ if (!_dbus_append_address_from_socket (fds[i], &address, error))
+ goto systemd_err;
+ }
+
+ *server_p = _dbus_server_new_for_socket (fds, n, &address, NULL);
+ if (*server_p == NULL)
+ goto systemd_oom;
+
+ dbus_free (fds);
+
+ return DBUS_SERVER_LISTEN_OK;
+ systemd_oom:
+ _DBUS_SET_OOM (error);
+ systemd_err:
+ for (i = 0; i < n; i++)
+ {
+ _dbus_close_socket (fds[i], NULL);
+ }
+ dbus_free (fds);
+ _dbus_string_free (&address);
+
+ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
+ }
+#ifdef DBUS_ENABLE_LAUNCHD
+ else if (strcmp (method, "launchd") == 0)
+ {
+ const char *launchd_env_var = dbus_address_entry_get_value (entry, "env");
+ if (launchd_env_var == NULL)
+ {
+ _dbus_set_bad_address (error, "launchd", "env", NULL);
+ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
+ }
+ *server_p = _dbus_server_new_for_launchd (launchd_env_var, error);
+
+ if (*server_p != NULL)
+ {
+ _DBUS_ASSERT_ERROR_IS_CLEAR(error);
+ return DBUS_SERVER_LISTEN_OK;
+ }
+ else
+ {
+ _DBUS_ASSERT_ERROR_IS_SET(error);
+ return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
+ }
+ }
+#endif