Added missing logging to externcmd.c

Not all failures caused an error to be logged.
This commit is contained in:
Markus Makela
2015-11-26 12:12:10 +02:00
parent 573af3c4c1
commit 230978f6db
2 changed files with 7 additions and 3 deletions

View File

@ -107,12 +107,16 @@ EXTERNCMD* externcmd_allocate(char* argstr)
}
else
{
MXS_ERROR("Failed to parse argument string for external command: %s",
argstr);
externcmd_free(cmd);
cmd = NULL;
}
}
else
{
MXS_ERROR("Memory allocation for external command parameters failed when "
"processing '%s'.", argstr);
free(cmd);
free(argv);
cmd = NULL;

View File

@ -785,7 +785,8 @@ monitor_launch_script(MONITOR* mon, MONITOR_SERVERS* ptr, char* script)
if (cmd == NULL)
{
MXS_ERROR("Failed to initialize script: %s", script);
MXS_ERROR("Failed to initialize script '%s'. See previous errors for the "
"cause of this failure.", script);
return;
}
@ -795,8 +796,7 @@ monitor_launch_script(MONITOR* mon, MONITOR_SERVERS* ptr, char* script)
if (externcmd_execute(cmd))
{
MXS_ERROR("Failed to execute script "
"'%s' on server state change event %s.",
MXS_ERROR("Failed to execute script '%s' on server state change event %s.",
script, mon_get_event_name(ptr));
}
externcmd_free(cmd);