diff options
author | Magnus Svensson <msvensson@mysql.com> | 2008-11-14 11:08:09 +0100 |
---|---|---|
committer | Magnus Svensson <msvensson@mysql.com> | 2008-11-14 11:08:09 +0100 |
commit | 562f1d6571129afcda902ce8275d6049dc0c0a52 (patch) | |
tree | 7d24a0fd77f7db76e6afadf269414d353da23d3e /client/mysqltest.cc | |
parent | 34ff714b0d5456901e979e280399579d3ab3338c (diff) | |
download | mariadb-git-562f1d6571129afcda902ce8275d6049dc0c0a52.tar.gz |
WL#4189 Make mysqltest die if fflush fails
Diffstat (limited to 'client/mysqltest.cc')
-rw-r--r-- | client/mysqltest.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index be95e595d23..ae68e642130 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -537,7 +537,10 @@ public: void flush() { 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) @@ -552,8 +555,6 @@ public: if (fwrite(ds->str, 1, ds->length, m_file) != ds->length) die("Failed to write %lu bytes to '%s', errno: %d", (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; DBUG_VOID_RETURN; } |