diff --git a/mysys/my_init.c b/mysys/my_init.c index bee485c3bedab3441b26f64e6343d2a8022fbd84..c50c00c1e5cd914163c49f8c597fb9b13b005b41 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -127,11 +127,18 @@ my_bool my_init(void) void my_end(int infoflag) { - FILE *info_file; - if (!(info_file=DBUG_FILE)) - info_file=stderr; - DBUG_PRINT("info",("Shutting down")); - if (infoflag & MY_CHECK_ERROR || info_file != stderr) + DBUG_ENTER("my_end"); + FILE *info_file= DBUG_FILE; + bool print_info= (info_file != stderr); + if (!info_file) + { + info_file= stderr; + print_info= 0; + } + + DBUG_PRINT("info",("Shutting down: print_info: %d", print_info)); + if ((infoflag & MY_CHECK_ERROR) || print_info) + { /* Test if some file is left open */ if (my_file_opened | my_stream_opened) { @@ -141,7 +148,8 @@ void my_end(int infoflag) } } my_once_free(); - if (infoflag & MY_GIVE_INFO || info_file != stderr) + + if ((infoflag & MY_GIVE_INFO) || print_info) { #ifdef HAVE_GETRUSAGE struct rusage rus;