Allow NULL parameters for start/stop functions
The functions that start and stop monitors and services now accept NULL parameters.
This commit is contained in:
@ -163,6 +163,8 @@ monitor_free(MXS_MONITOR *mon)
|
||||
*/
|
||||
void
|
||||
monitorStart(MXS_MONITOR *monitor, const MXS_CONFIG_PARAMETER* params)
|
||||
{
|
||||
if (monitor)
|
||||
{
|
||||
spinlock_acquire(&monitor->lock);
|
||||
|
||||
@ -177,6 +179,7 @@ monitorStart(MXS_MONITOR *monitor, const MXS_CONFIG_PARAMETER* params)
|
||||
|
||||
spinlock_release(&monitor->lock);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Start all monitors
|
||||
@ -202,6 +205,8 @@ void monitorStartAll()
|
||||
*/
|
||||
void
|
||||
monitorStop(MXS_MONITOR *monitor)
|
||||
{
|
||||
if (monitor)
|
||||
{
|
||||
spinlock_acquire(&monitor->lock);
|
||||
|
||||
@ -224,6 +229,7 @@ monitorStop(MXS_MONITOR *monitor)
|
||||
|
||||
spinlock_release(&monitor->lock);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown all running monitors
|
||||
|
@ -627,11 +627,11 @@ int service_launch_all()
|
||||
|
||||
bool serviceStop(SERVICE *service)
|
||||
{
|
||||
SERV_LISTENER *port;
|
||||
int listeners = 0;
|
||||
|
||||
port = service->ports;
|
||||
while (port)
|
||||
if (service)
|
||||
{
|
||||
for (SERV_LISTENER * port = service->ports; port; port = port->next)
|
||||
{
|
||||
if (port->listener && port->listener->session->state == SESSION_STATE_LISTENER)
|
||||
{
|
||||
@ -641,9 +641,10 @@ bool serviceStop(SERVICE *service)
|
||||
listeners++;
|
||||
}
|
||||
}
|
||||
port = port->next;
|
||||
}
|
||||
|
||||
service->state = SERVICE_STATE_STOPPED;
|
||||
}
|
||||
|
||||
return listeners > 0;
|
||||
}
|
||||
@ -658,11 +659,11 @@ bool serviceStop(SERVICE *service)
|
||||
*/
|
||||
bool serviceStart(SERVICE *service)
|
||||
{
|
||||
SERV_LISTENER *port;
|
||||
int listeners = 0;
|
||||
|
||||
port = service->ports;
|
||||
while (port)
|
||||
if (service)
|
||||
{
|
||||
for (SERV_LISTENER* port = service->ports; port; port = port->next)
|
||||
{
|
||||
if (port->listener && port->listener->session->state == SESSION_STATE_LISTENER_STOPPED)
|
||||
{
|
||||
@ -672,9 +673,11 @@ bool serviceStart(SERVICE *service)
|
||||
listeners++;
|
||||
}
|
||||
}
|
||||
port = port->next;
|
||||
}
|
||||
|
||||
service->state = SERVICE_STATE_STARTED;
|
||||
}
|
||||
|
||||
return listeners > 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user