diff --git a/server/core/CMakeLists.txt b/server/core/CMakeLists.txt index d2633e4b5..aa9cf19e1 100644 --- a/server/core/CMakeLists.txt +++ b/server/core/CMakeLists.txt @@ -19,7 +19,8 @@ add_library(maxscale-common SHARED misc.cc mlist.cc modutil.cc - monitor.c queuemanager.c query_classifier.cc poll.c random_jkiss.c resultset.c router.cc secrets.c server.c service.c session.c spinlock.c thread.c users.c utils.c skygw_utils.cc statistics.c listener.c ssl.c mysql_utils.c mysql_binlog.c modulecmd.c) + monitor.cc + queuemanager.c query_classifier.cc poll.c random_jkiss.c resultset.c router.cc secrets.c server.c service.c session.c spinlock.c thread.c users.c utils.c skygw_utils.cc statistics.c listener.c ssl.c mysql_utils.c mysql_binlog.c modulecmd.c) if(WITH_JEMALLOC) target_link_libraries(maxscale-common ${JEMALLOC_LIBRARIES}) diff --git a/server/core/maxscale/monitor.h b/server/core/maxscale/monitor.h index bb4533963..12509baa5 100644 --- a/server/core/maxscale/monitor.h +++ b/server/core/maxscale/monitor.h @@ -41,7 +41,7 @@ typedef enum MXS_MONITOR *monitor_alloc(char *, char *); void monitor_free(MXS_MONITOR *); -void monitorStart(MXS_MONITOR *, void*); +void monitorStart(MXS_MONITOR *, const MXS_CONFIG_PARAMETER*); void monitorStop(MXS_MONITOR *); void monitorStopAll(); void monitorStartAll(); diff --git a/server/core/monitor.c b/server/core/monitor.cc similarity index 99% rename from server/core/monitor.c rename to server/core/monitor.cc index 7d293cf78..18dc52086 100644 --- a/server/core/monitor.c +++ b/server/core/monitor.cc @@ -86,7 +86,7 @@ monitor_alloc(char *name, char *module) return NULL; } - if ((mon->module = load_module(module, MODULE_MONITOR)) == NULL) + if ((mon->module = (MXS_MONITOR_OBJECT*)load_module(module, MODULE_MONITOR)) == NULL) { MXS_ERROR("Unable to load monitor module '%s'.", name); MXS_FREE(name); @@ -161,7 +161,7 @@ monitor_free(MXS_MONITOR *mon) * @param monitor The Monitor that should be started */ void -monitorStart(MXS_MONITOR *monitor, void* params) +monitorStart(MXS_MONITOR *monitor, const MXS_CONFIG_PARAMETER* params) { spinlock_acquire(&monitor->lock); @@ -957,7 +957,7 @@ static const char* mon_get_event_name(MXS_MONITOR_SERVERS* node) */ static void mon_append_node_names(MXS_MONITOR_SERVERS* servers, char* dest, int len, int status) { - char *separator = ""; + const char *separator = ""; char arr[MAX_SERVER_NAME_LEN + 64]; // Some extra space for port and separator dest[0] = '\0'; @@ -991,7 +991,7 @@ bool mon_status_changed(MXS_MONITOR_SERVERS* mon_srv) bool rval = false; /* Previous status is -1 if not yet set */ - if (mon_srv->mon_prev_status != -1) + if (mon_srv->mon_prev_status != (uint32_t)-1) { unsigned int old_status = mon_srv->mon_prev_status & all_server_bits; @@ -1107,7 +1107,7 @@ monitor_launch_script(MXS_MONITOR* mon, MXS_MONITOR_SERVERS* ptr, const char* sc totalStrLen += strlen(cmd->argv[i]) + 1; // +1 for space and one \0 } int spaceRemaining = totalStrLen; - if ((scriptStr = MXS_CALLOC(totalStrLen, sizeof(char))) != NULL) + if ((scriptStr = (char*)MXS_CALLOC(totalStrLen, sizeof(char))) != NULL) { char *currentPos = scriptStr; // The script name should not begin with a space