Переглянути джерело

NOTIFYD: fix retrieving the application's parent name.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
Angus Salkeld 15 роки тому
батько
коміт
a97e1f0813
1 змінених файлів з 3 додано та 11 видалено
  1. 3 11
      tools/corosync-notifyd.c

+ 3 - 11
tools/corosync-notifyd.c

@@ -275,26 +275,18 @@ _cs_confdb_object_created(confdb_handle_t handle,
 	char parent_name[CS_MAX_NAME_LENGTH];
 	size_t len = 0;
 	char obj_name[CS_MAX_NAME_LENGTH];
-	hdb_handle_t real_parent_object_handle;
 	cs_error_t rc = CS_OK;
 
 	memcpy(obj_name, name_pt, name_len);
 	obj_name[name_len] = '\0';
 
-	rc = confdb_object_parent_get (handle,
-		parent_object_handle, &real_parent_object_handle);
+	rc = confdb_object_name_get (handle,
+		object_handle, parent_name, &len);
+	parent_name[len] = '\0';
 	if (rc != CS_OK) {
-		/* this error is normally from our own cfg connection
-		 * which is short lived.
-		 */
 		return;
 	}
 
-	rc = confdb_object_name_get (handle,
-		real_parent_object_handle, parent_name, &len);
-	parent_name[len] = '\0';
-	assert(rc == CS_OK);
-
 	if (strcmp(parent_name, "connections") == 0) {
 		_cs_application_connection_event(obj_name, "connected");
 	}