MXS-1300: Fix deletion of monitors
The monitors should only be reused if they have the same name and they use the same module. This way the only difference is in configuration. Fixed MaxCtrl detection of bad options and altered monitor creation test to expect correct results. Also improved some of the error messages.
This commit is contained in:
@ -574,7 +574,7 @@ monitor_find(const char *name)
|
||||
* @param name The name of the monitor
|
||||
* @return Pointer to the destroyed monitor or NULL if monitor is not found
|
||||
*/
|
||||
MXS_MONITOR* monitor_find_destroyed(const char *name)
|
||||
MXS_MONITOR* monitor_find_destroyed(const char* name, const char* module)
|
||||
{
|
||||
MXS_MONITOR* rval = NULL;
|
||||
|
||||
@ -582,7 +582,7 @@ MXS_MONITOR* monitor_find_destroyed(const char *name)
|
||||
|
||||
for (MXS_MONITOR *ptr = allMonitors; ptr; ptr = ptr->next)
|
||||
{
|
||||
if (!strcmp(ptr->name, name))
|
||||
if (strcmp(ptr->name, name) == 0 && strcmp(ptr->module_name, module) == 0)
|
||||
{
|
||||
rval = ptr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user