Commit 58d6a9a3 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

msvcrt: Add a helper function to flush all buffers.

parent 1a01893c
......@@ -748,13 +748,11 @@ int CDECL MSVCRT__wunlink(const MSVCRT_wchar_t *path)
return -1;
}
/* _flushall calls MSVCRT_fflush which calls _flushall */
/* flush_all_buffers calls MSVCRT_fflush which calls flush_all_buffers */
int CDECL MSVCRT_fflush(MSVCRT_FILE* file);
/*********************************************************************
* _flushall (MSVCRT.@)
*/
int CDECL MSVCRT__flushall(void)
/* INTERNAL: Flush all stream buffer */
static int msvcrt_flush_all_buffers(int mask)
{
int i, num_flushed = 0;
MSVCRT_FILE *file;
......@@ -765,7 +763,7 @@ int CDECL MSVCRT__flushall(void)
if (file->_flag)
{
if(file->_flag & MSVCRT__IOWRT) {
if(file->_flag & mask) {
MSVCRT_fflush(file);
num_flushed++;
}
......@@ -778,6 +776,14 @@ int CDECL MSVCRT__flushall(void)
}
/*********************************************************************
* _flushall (MSVCRT.@)
*/
int CDECL MSVCRT__flushall(void)
{
return msvcrt_flush_all_buffers(MSVCRT__IOWRT);
}
/*********************************************************************
* fflush (MSVCRT.@)
*/
int CDECL MSVCRT_fflush(MSVCRT_FILE* file)
......
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