Merge branch 'release-1.0beta-refresh' of github.com:skysql/MaxScale into release-1.0beta-refresh
This commit is contained in:
@ -1688,8 +1688,13 @@ static void log_flush_cb(
|
||||
static void unlink_pidfile(void)
|
||||
{
|
||||
if (strlen(pidfile)) {
|
||||
if (unlink(pidfile)) {
|
||||
fprintf(stderr, "MaxScale failed to remove pidfile %s: error %d, %s\n", pidfile, errno, strerror(errno));
|
||||
if (unlink(pidfile))
|
||||
{
|
||||
fprintf(stderr,
|
||||
"MaxScale failed to remove pidfile %s: error %d, %s\n",
|
||||
pidfile,
|
||||
errno,
|
||||
strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <hint.h>
|
||||
|
||||
/**
|
||||
|
||||
@ -60,8 +60,9 @@ MONITOR *mon;
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mon->state = MONITOR_STATE_ALLOC;
|
||||
mon->name = strdup(name);
|
||||
|
||||
if ((mon->module = load_module(module, MODULE_MONITOR)) == NULL)
|
||||
{
|
||||
LOGIF(LE, (skygw_log_write_flush(
|
||||
@ -73,7 +74,8 @@ MONITOR *mon;
|
||||
return NULL;
|
||||
}
|
||||
mon->handle = (*mon->module->startMonitor)(NULL);
|
||||
mon->state |= MONITOR_STATE_RUNNING;
|
||||
mon->state = MONITOR_STATE_RUNNING;
|
||||
|
||||
spinlock_acquire(&monLock);
|
||||
mon->next = allMonitors;
|
||||
allMonitors = mon;
|
||||
@ -94,7 +96,7 @@ monitor_free(MONITOR *mon)
|
||||
MONITOR *ptr;
|
||||
|
||||
mon->module->stopMonitor(mon->handle);
|
||||
mon->state &= ~MONITOR_STATE_RUNNING;
|
||||
mon->state = MONITOR_STATE_FREED;
|
||||
spinlock_acquire(&monLock);
|
||||
if (allMonitors == mon)
|
||||
allMonitors = mon->next;
|
||||
@ -121,7 +123,7 @@ void
|
||||
monitorStart(MONITOR *monitor)
|
||||
{
|
||||
monitor->handle = (*monitor->module->startMonitor)(monitor->handle);
|
||||
monitor->state |= MONITOR_STATE_RUNNING;
|
||||
monitor->state = MONITOR_STATE_RUNNING;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,8 +134,9 @@ monitorStart(MONITOR *monitor)
|
||||
void
|
||||
monitorStop(MONITOR *monitor)
|
||||
{
|
||||
monitor->state = MONITOR_STATE_STOPPING;
|
||||
monitor->module->stopMonitor(monitor->handle);
|
||||
monitor->state &= ~MONITOR_STATE_RUNNING;
|
||||
monitor->state = MONITOR_STATE_STOPPED;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -667,7 +667,7 @@ DCB *zombies = NULL;
|
||||
#endif
|
||||
} /*< for */
|
||||
no_op = FALSE;
|
||||
}
|
||||
} /*< if (nfds > 0) */
|
||||
process_zombies:
|
||||
if (thread_data)
|
||||
{
|
||||
@ -690,6 +690,8 @@ process_zombies:
|
||||
thread_data[thread_id].state = THREAD_STOPPED;
|
||||
}
|
||||
bitmask_clear(&poll_mask, thread_id);
|
||||
/** Release mysql thread context */
|
||||
mysql_thread_end();
|
||||
return;
|
||||
}
|
||||
if (thread_data)
|
||||
@ -697,8 +699,6 @@ process_zombies:
|
||||
thread_data[thread_id].state = THREAD_IDLE;
|
||||
}
|
||||
} /*< while(1) */
|
||||
/** Release mysql thread context */
|
||||
mysql_thread_end();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user