From fa8f6a5da30a5d6fa02b655aa3d00325813e2030 Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Wed, 7 Feb 2018 16:03:56 +0200 Subject: [PATCH] Fix monitor error with empty servers_no_promotion --- server/core/monitor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/core/monitor.cc b/server/core/monitor.cc index 98875a05d..6a6dedcd2 100644 --- a/server/core/monitor.cc +++ b/server/core/monitor.cc @@ -2447,7 +2447,7 @@ int mon_config_get_servers(const MXS_CONFIG_PARAMETER* params, const char* key, ss_dassert(*monitored_servers_out == NULL); SERVER** servers = NULL; int servers_size = config_get_server_list(params, key, &servers); - int rval = -1; + int rval = 0; // All servers in the array must be monitored by the given monitor. if (servers_size > 0) { @@ -2472,6 +2472,7 @@ int mon_config_get_servers(const MXS_CONFIG_PARAMETER* params, const char* key, if (error) { MXS_FREE(monitored_array); + rval = -1; } else {