Fix refactoring errors
The monitor deletion would mistakenly label all monitors as not being created at runtime. Due to this, the deletion of monitors would fail.
This commit is contained in:
@ -884,20 +884,10 @@ bool runtime_destroy_monitor(MXS_MONITOR *monitor)
|
||||
|
||||
spinlock_acquire(&crt_lock);
|
||||
|
||||
if (unlink(filename) == -1)
|
||||
if (unlink(filename) == -1 && errno != ENOENT)
|
||||
{
|
||||
if (errno != ENOENT)
|
||||
{
|
||||
MXS_ERROR("Failed to remove persisted monitor configuration '%s': %d, %s",
|
||||
filename, errno, mxs_strerror(errno));
|
||||
}
|
||||
else
|
||||
{
|
||||
rval = false;
|
||||
MXS_WARNING("Monitor '%s' was not created at runtime. Remove the "
|
||||
"monitor manually from the correct configuration file.",
|
||||
monitor->name);
|
||||
}
|
||||
MXS_ERROR("Failed to remove persisted monitor configuration '%s': %d, %s",
|
||||
filename, errno, mxs_strerror(errno));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user