msvcrt: Make fflush function thread safe.

oldstable
Piotr Caban 2011-05-20 13:21:29 +02:00 committed by Alexandre Julliard
parent 23a0d0f04a
commit d18f0766f7
1 changed files with 12 additions and 7 deletions

View File

@ -774,13 +774,18 @@ int CDECL _flushall(void)
*/
int CDECL MSVCRT_fflush(MSVCRT_FILE* file)
{
if(!file) {
_flushall();
} else if(file->_flag & MSVCRT__IOWRT) {
int res=msvcrt_flush_buffer(file);
return res;
}
return 0;
if(!file) {
_flushall();
} else if(file->_flag & MSVCRT__IOWRT) {
int res;
MSVCRT__lock_file(file);
res = msvcrt_flush_buffer(file);
MSVCRT__unlock_file(file);
return res;
}
return 0;
}
/*********************************************************************