Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:Update
pacemaker.3577
pacemaker-libcib-deletion-notice-registration.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pacemaker-libcib-deletion-notice-registration.patch of Package pacemaker.3577
commit 9b4ee98cbfdadcd9f9bc479de0c14a233b46bda7 Author: HideoYamauchi <renayama19661014@ybb.ne.jp> Date: Tue Jul 26 13:31:42 2016 +0900 High: lib: Correction of the deletion of the notice registration. diff --git a/lib/cib/cib_client.c b/lib/cib/cib_client.c index f7a19b8..b0d156c 100644 --- a/lib/cib/cib_client.c +++ b/lib/cib/cib_client.c @@ -477,6 +477,23 @@ cib_client_add_notify_callback(cib_t * cib, const char *event, return pcmk_ok; } +static int +get_notify_list_event_count(cib_t * cib, const char *event) +{ + GList *l = NULL; + int count = 0; + + for (l = g_list_first(cib->notify_list); l; l = g_list_next(l)) { + cib_notify_client_t *client = (cib_notify_client_t *)l->data; + + if (strcmp(client->event, event) == 0) { + count++; + } + } + crm_trace("event(%s) count : %d", event, count); + return count; +} + int cib_client_del_notify_callback(cib_t * cib, const char *event, void (*callback) (const char *event, xmlNode * msg)) @@ -488,6 +505,11 @@ cib_client_del_notify_callback(cib_t * cib, const char *event, return -EPROTONOSUPPORT; } + if (get_notify_list_event_count(cib, event) == 0) { + crm_debug("The callback of the event does not exist(%s)", event); + return pcmk_ok; + } + crm_debug("Removing callback for %s events", event); new_client = calloc(1, sizeof(cib_notify_client_t)); @@ -496,8 +518,6 @@ cib_client_del_notify_callback(cib_t * cib, const char *event, list_item = g_list_find_custom(cib->notify_list, new_client, ciblib_GCompareFunc); - cib->cmds->register_notification(cib, event, 0); - if (list_item != NULL) { cib_notify_client_t *list_client = list_item->data; @@ -509,6 +529,12 @@ cib_client_del_notify_callback(cib_t * cib, const char *event, } else { crm_trace("Callback not present"); } + + if (get_notify_list_event_count(cib, event) == 0) { + /* When there is not the registration of the event, the processing turns off a notice. */ + cib->cmds->register_notification(cib, event, 0); + } + free(new_client); return pcmk_ok; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor