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)
|
int CDECL MSVCRT_fflush(MSVCRT_FILE* file)
|
||||||
{
|
{
|
||||||
if(!file) {
|
if(!file) {
|
||||||
_flushall();
|
_flushall();
|
||||||
} else if(file->_flag & MSVCRT__IOWRT) {
|
} else if(file->_flag & MSVCRT__IOWRT) {
|
||||||
int res=msvcrt_flush_buffer(file);
|
int res;
|
||||||
return res;
|
|
||||||
}
|
MSVCRT__lock_file(file);
|
||||||
return 0;
|
res = msvcrt_flush_buffer(file);
|
||||||
|
MSVCRT__unlock_file(file);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
|
Loading…
Reference in New Issue