diff options
author | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-03-12 11:31:40 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@montyprogram.com> | 2012-03-12 11:31:40 +0100 |
commit | 8245178f5d55d2f1f90e87a78a0c5c5245875809 (patch) | |
tree | 08ebb28223690a2e3fb187d9c2a5f9ac4f6f809c | |
parent | 60aad314224227fb5e652bfa094fb01373414a37 (diff) | |
download | mariadb-git-8245178f5d55d2f1f90e87a78a0c5c5245875809.tar.gz |
LP953714: Fix formatting of the crash messages in signal/exception handler
-rw-r--r-- | mysys/stacktrace.c | 18 | ||||
-rw-r--r-- | sql/signal_handler.cc | 2 |
2 files changed, 8 insertions, 12 deletions
diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 847cc746a76..c59be6b1f48 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -685,7 +685,7 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) &(package.sym)); have_source= pSymGetLineFromAddr64(hProcess, addr, &line_offset, &line); - my_safe_printf_stderr("%p ", addr); + fprintf(stderr,"%p ", addr); if(have_module) { char *base_image_name= strrchr(module.ImageName, '\\'); @@ -693,13 +693,12 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) base_image_name++; else base_image_name= module.ImageName; - my_safe_printf_stderr("%s!", base_image_name); + fprintf(stderr,"%s!", base_image_name); } if(have_symbol) - my_safe_printf_stderr("%s()", package.sym.Name); - + fprintf(stderr, "%s()", package.sym.Name); else if(have_module) - my_safe_printf_stderr("%s", "???"); + fprintf(stderr,"%s", "???"); if(have_source) { @@ -708,10 +707,10 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) base_file_name++; else base_file_name= line.FileName; - my_safe_printf_stderr("[%s:%u]", + fprintf(stderr, "[%s:%u]", base_file_name, line.LineNumber); } - my_safe_printf_stderr("%s", "\n"); + fprintf(stderr,"%s", "\n"); } } @@ -785,10 +784,7 @@ void my_safe_print_str(const char *val, int len) #ifdef __WIN__ size_t my_write_stderr(const void *buf, size_t count) { - DWORD bytes_written; - SetFilePointer(GetStdHandle(STD_ERROR_HANDLE), 0, NULL, FILE_END); - WriteFile(GetStdHandle(STD_ERROR_HANDLE), buf, count, &bytes_written, NULL); - return bytes_written; + return fwrite(buf, 1, count, stderr); } #else size_t my_write_stderr(const void *buf, size_t count) diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index ae0cf6e1bb0..15be12b50ec 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -72,7 +72,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) curr_time= my_time(0); localtime_r(&curr_time, &tm); - my_safe_printf_stderr("%02d%02d%02d %2d:%02d:%02d ", + fprintf(stderr, "%02d%02d%02d %2d:%02d:%02d ", tm.tm_year % 100, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); if (opt_expect_abort |