+
+ if (service->timeout > 0)
+ g_source_remove(service->timeout);
+
+ if (service->pending != NULL) {
+ g_dbus_send_reply(connection, service->pending,
+ DBUS_TYPE_INVALID);
+
+ dbus_message_unref(service->pending);
+ service->pending = NULL;
+ }
+
+ }
+
+ if (state == CONNMAN_SERVICE_STATE_FAILURE) {
+ if (service->timeout > 0)
+ g_source_remove(service->timeout);
+
+ if (service->pending != NULL) {
+ DBusMessage *reply;
+
+ reply = __connman_error_failed(service->pending, EIO);
+ if (reply != NULL)
+ g_dbus_send_message(connection, reply);
+
+ dbus_message_unref(service->pending);
+ service->pending = NULL;
+ }