This commit is contained in:
yangyingchao 2024-07-16 09:07:39 +08:00
parent 5f3a9d9423
commit b65ca334a8
1 changed files with 3 additions and 4 deletions

View File

@ -67,10 +67,9 @@ gboolean Watcher::handleRegisterHost(Watcher* obj, GDBusMethodInvocation* invoca
} }
auto watch = gfWatchFind(obj->hosts_, bus_name, object_path); auto watch = gfWatchFind(obj->hosts_, bus_name, object_path);
if (watch != nullptr) { if (watch != nullptr) {
g_dbus_method_invocation_return_error( g_warning("Status Notifier Host with bus name '%s' and object path '%s' is already registered",
invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS,
"Status Notifier Host with bus name '%s' and object path '%s' is already registered",
bus_name, object_path); bus_name, object_path);
sn_watcher_complete_register_item(obj->watcher_, invocation);
return TRUE; return TRUE;
} }
watch = gfWatchNew(GF_WATCH_TYPE_HOST, service, bus_name, object_path, obj); watch = gfWatchNew(GF_WATCH_TYPE_HOST, service, bus_name, object_path, obj);