Commit 34ff714b authored by Magnus Svensson's avatar Magnus Svensson

WL#4189 Make mysqltest flush log file at close if logfile is stdout

parent c35214cd
...@@ -525,8 +525,12 @@ public: ...@@ -525,8 +525,12 @@ public:
void close() void close()
{ {
if (m_file && m_file != stdout) if (m_file) {
fclose(m_file); if (m_file != stdout)
fclose(m_file);
else
fflush(m_file);
}
m_file= NULL; m_file= NULL;
} }
...@@ -548,6 +552,8 @@ public: ...@@ -548,6 +552,8 @@ public:
if (fwrite(ds->str, 1, ds->length, m_file) != ds->length) if (fwrite(ds->str, 1, ds->length, m_file) != ds->length)
die("Failed to write %lu bytes to '%s', errno: %d", die("Failed to write %lu bytes to '%s', errno: %d",
(unsigned long)ds->length, m_file_name, errno); (unsigned long)ds->length, m_file_name, errno);
if (fflush(m_file))
die("Failed to flush '%s', errno: %d", m_file_name, errno);
m_bytes_written+= ds->length; m_bytes_written+= ds->length;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment