Commit 9b3900c1 authored by Magnus Svensson's avatar Magnus Svensson

WL#4189 Make mysqltest die if fflush fails

parent 08023235
...@@ -537,7 +537,10 @@ class LogFile { ...@@ -537,7 +537,10 @@ class LogFile {
void flush() void flush()
{ {
if (m_file && m_file != stdout) if (m_file && m_file != stdout)
fflush(m_file); {
if (fflush(m_file))
die("Failed to flush '%s', errno: %d", m_file_name, errno);
}
} }
void write(DYNAMIC_STRING* ds) void write(DYNAMIC_STRING* ds)
...@@ -552,8 +555,6 @@ class LogFile { ...@@ -552,8 +555,6 @@ class LogFile {
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