summaryrefslogtreecommitdiff
path: root/dbug
diff options
context:
space:
mode:
Diffstat (limited to 'dbug')
-rw-r--r--dbug/dbug.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c
index 169dd226419..1aa587ac246 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -85,6 +85,9 @@
#undef SAFE_MUTEX
#include <m_string.h>
#include <errno.h>
+#ifdef HAVE_gcov
+extern void __gcov_flush();
+#endif
#ifndef DBUG_OFF
@@ -94,7 +97,7 @@
#define fnmatch(A,B,C) strcmp(A,B)
#endif
-#if defined(__WIN__)
+#if defined(_WIN32)
#include <process.h>
#endif
@@ -1869,7 +1872,7 @@ static void DoPrefix(CODE_STATE *cs, uint _line_)
(void) fprintf(cs->stack->out_file->file, "%5d: ", cs->lineno);
if (cs->stack->flags & TIMESTAMP_ON)
{
-#ifdef __WIN__
+#ifdef _WIN32
/* FIXME This doesn't give microseconds as in Unix case, and the resolution is
in system ticks, 10 ms intervals. See my_getsystime.c for high res */
SYSTEMTIME loc_t;
@@ -2199,7 +2202,7 @@ void _db_flush_()
}
-#ifndef __WIN__
+#ifndef _WIN32
void _db_suicide_()
{
int retval;
@@ -2208,6 +2211,9 @@ void _db_suicide_()
fprintf(stderr, "SIGKILL myself\n");
fflush(stderr);
+#ifdef HAVE_gcov
+ __gcov_flush();
+#endif
retval= kill(getpid(), SIGKILL);
assert(retval == 0);
@@ -2215,7 +2221,7 @@ void _db_suicide_()
fprintf(stderr, "sigsuspend returned %d errno %d \n", retval, errno);
assert(FALSE); /* With full signal mask, we should never return here. */
}
-#endif /* ! __WIN__ */
+#endif /* ! _WIN32 */
void _db_lock_file_()
@@ -2252,7 +2258,13 @@ my_bool _db_my_assert(const char *file, int line, const char *msg)
my_bool a = my_assert;
_db_flush_();
if (!a)
+ {
fprintf(stderr, "%s:%d: assert: %s\n", file, line, msg);
+ fflush(stderr);
+#ifdef HAVE_gcov
+ __gcov_flush();
+#endif
+ }
return a;
}
#else