diff options
author | Galina Shalygina <galina.shalygina@mariadb.com> | 2018-06-01 21:57:10 +0200 |
---|---|---|
committer | Galina Shalygina <galina.shalygina@mariadb.com> | 2018-06-01 21:57:10 +0200 |
commit | 6db465d7ce455cf75ec224108cbe61ca8be63d3d (patch) | |
tree | 9648ff1fc677eebb60b278c2e2c13131934ed2a0 /mysys/my_init.c | |
parent | ffe83e8e7bef32eb2a80aad2d382f0b023dd3a44 (diff) | |
parent | 4a49f7f88cfa82ae6eb8e7b5a528e91416b33b52 (diff) | |
download | mariadb-git-shagalla-10.4.tar.gz |
Merge 10.3.7 into 10.4shagalla-10.4
Diffstat (limited to 'mysys/my_init.c')
-rw-r--r-- | mysys/my_init.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/mysys/my_init.c b/mysys/my_init.c index 9bd1185a3bf..972750da0ff 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -122,6 +122,9 @@ my_bool my_init(void) #ifdef __WIN__ win32_init_tcp_ip(); #endif +#ifdef CHECK_UNLIKELY + init_my_likely(); +#endif DBUG_RETURN(0); } } /* my_init */ @@ -155,17 +158,36 @@ void my_end(int infoflag) } if ((infoflag & MY_CHECK_ERROR) || print_info) + { /* Test if some file is left open */ + char ebuff[512]; + uint i, open_files, open_streams; + + for (open_streams= open_files= i= 0 ; i < my_file_limit ; i++) + { + if (my_file_info[i].type == UNOPEN) + continue; + if (my_file_info[i].type == STREAM_BY_FOPEN || + my_file_info[i].type == STREAM_BY_FDOPEN) + open_streams++; + else + open_files++; - { /* Test if some file is left open */ - if (my_file_opened | my_stream_opened) +#ifdef EXTRA_DEBUG + fprintf(stderr, EE(EE_FILE_NOT_CLOSED), my_file_info[i].name, i); + fputc('\n', stderr); +#endif + } + if (open_files || open_streams) { - char ebuff[512]; my_snprintf(ebuff, sizeof(ebuff), EE(EE_OPEN_WARNING), - my_file_opened, my_stream_opened); + open_files, open_streams); my_message_stderr(EE_OPEN_WARNING, ebuff, ME_BELL); DBUG_PRINT("error", ("%s", ebuff)); - my_print_open_files(); } + +#ifdef CHECK_UNLIKELY + end_my_likely(info_file); +#endif } free_charsets(); my_error_unregister_all(); |