"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "base/nebmods.c" between
nagios-4.4.3.tar.gz and nagios-4.4.4.tar.gz

About: Nagios (Core) is an host/service/network monitoring system to identify and resolve IT infrastructure problems.

nebmods.c  (nagios-4.4.3):nebmods.c  (nagios-4.4.4)
skipping to change at line 392 skipping to change at line 392
return NEBERROR_BADMODULEHANDLE; return NEBERROR_BADMODULEHANDLE;
/* allocate memory */ /* allocate memory */
new_callback = (nebcallback *)malloc(sizeof(nebcallback)); new_callback = (nebcallback *)malloc(sizeof(nebcallback));
if(new_callback == NULL) if(new_callback == NULL)
return NEBERROR_NOMEM; return NEBERROR_NOMEM;
new_callback->priority = priority; new_callback->priority = priority;
new_callback->module_handle = mod_handle; new_callback->module_handle = mod_handle;
new_callback->callback_func = callback_func; new_callback->callback_func = callback_func;
new_callback->next = NULL;
/* add new function to callback list, sorted by priority (first come, fir st served for same priority) */ /* add new function to callback list, sorted by priority (first come, fir st served for same priority) */
new_callback->next = NULL;
if(neb_callback_list[callback_type] == NULL) for(last_callback = NULL, temp_callback = neb_callback_list[callback_type
];
temp_callback != NULL;
last_callback = temp_callback, temp_callback = temp_callback->nex
t) {
if(new_callback->priority < temp_callback->priority) {
break;
}
}
new_callback->next = temp_callback;
if(last_callback == NULL) {
neb_callback_list[callback_type] = new_callback; neb_callback_list[callback_type] = new_callback;
}
else { else {
last_callback = NULL; last_callback->next = new_callback;
for(temp_callback = neb_callback_list[callback_type]; temp_callba
ck != NULL; temp_callback = temp_callback->next) {
if(temp_callback->priority > new_callback->priority)
break;
last_callback = temp_callback;
}
if(last_callback == NULL)
neb_callback_list[callback_type] = new_callback;
else {
if(temp_callback == NULL)
last_callback->next = new_callback;
else {
new_callback->next = temp_callback;
last_callback->next = new_callback;
}
}
} }
return OK; return OK;
} }
/* dregisters all callback functions for a given module */ /* dregisters all callback functions for a given module */
int neb_deregister_module_callbacks(nebmodule *mod) { int neb_deregister_module_callbacks(nebmodule *mod) {
nebcallback *temp_callback = NULL; nebcallback *temp_callback = NULL;
nebcallback *next_callback = NULL; nebcallback *next_callback = NULL;
int callback_type = 0; int callback_type = 0;
 End of changes. 4 change blocks. 
19 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)