msvcrt: Make fflush function thread safe.
This commit is contained in:
parent
23a0d0f04a
commit
d18f0766f7
|
@ -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;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
Loading…
Reference in New Issue