diff options
author | msvensson@neptunus.(none) <> | 2005-09-28 11:34:53 +0200 |
---|---|---|
committer | msvensson@neptunus.(none) <> | 2005-09-28 11:34:53 +0200 |
commit | fbf4a5e07962792a918207541a2666a7968df4ca (patch) | |
tree | 5b0761b29daf8c864538d0fb55e20e9b54758e47 /mysys | |
parent | 70b9b5eef34a608f415db270e1914e6163d90ced (diff) | |
parent | 1105d4293dfa37e1658956b07e48908495fa65f7 (diff) | |
download | mariadb-git-fbf4a5e07962792a918207541a2666a7968df4ca.tar.gz |
Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_init.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/mysys/my_init.c b/mysys/my_init.c index abb1ad27f7b..f28f47e090e 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -127,11 +127,23 @@ 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) + /* + this code is suboptimal to workaround a bug in + Sun CC: Sun C++ 5.6 2004/06/02 for x86, and should not be + optimized until this compiler is not in use anymore + */ + FILE *info_file= DBUG_FILE; + my_bool print_info= (info_file != stderr); + DBUG_ENTER("my_end"); + 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 +153,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; |