Do not re-initialize the log
Do not re-initialize the log without it having been finished in between.
This commit is contained in:
@ -753,10 +753,8 @@ static void print_log_n_stderr(
|
|||||||
{
|
{
|
||||||
if (do_log)
|
if (do_log)
|
||||||
{
|
{
|
||||||
static bool log_is_inited = false;
|
if (mxb_log_inited() || init_log())
|
||||||
if (log_is_inited || init_log())
|
|
||||||
{
|
{
|
||||||
log_is_inited = true;
|
|
||||||
MXS_ERROR("%s%s%s%s",
|
MXS_ERROR("%s%s%s%s",
|
||||||
logstr,
|
logstr,
|
||||||
eno == 0 ? "" : " (",
|
eno == 0 ? "" : " (",
|
||||||
@ -1860,6 +1858,14 @@ int main(int argc, char **argv)
|
|||||||
goto return_main;
|
goto return_main;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mxb_log_inited())
|
||||||
|
{
|
||||||
|
// If the log was inited due to some error logging *and* we did not exit,
|
||||||
|
// we need to close it so that it can be opened again, this time with
|
||||||
|
// the final settings.
|
||||||
|
mxs_log_finish();
|
||||||
|
}
|
||||||
|
|
||||||
if (!init_log())
|
if (!init_log())
|
||||||
{
|
{
|
||||||
rc = MAXSCALE_BADCONFIG;
|
rc = MAXSCALE_BADCONFIG;
|
||||||
|
|||||||
Reference in New Issue
Block a user