[3/3] msvcrt: Added _fflush_nolock() implementation
Piotr Caban
piotr.caban at gmail.com
Fri Oct 10 03:29:17 CDT 2014
On 10/09/14 19:52, Iván Matellanes wrote:
> @@ -921,22 +921,36 @@ int CDECL MSVCRT_fflush(MSVCRT_FILE* file)
> {
> if(!file) {
> msvcrt_flush_all_buffers(MSVCRT__IOWRT);
> + } else if(file->_flag & MSVCRT__IOWRT || file->_flag & MSVCRT__IOREAD) {
> + int ret;
> +
> + MSVCRT__lock_file(file);
> + ret = MSVCRT__fflush_nolock(file);
> + MSVCRT__unlock_file(file);
> +
> + return ret;
> + }
> + return 0;
> +}
file->_flag should be checked inside the lock (it's already done inside
fflush_nolock). Could you please change the code to something like this:
if(!file)
msvcrt_flush_all_buffers(MSVCRT__IOWRT);
MSVCRT__lock_file(file);
ret = MSVCRT__fflush_nolock(file);
MSVCRT__unlock_file(file);
Thanks,
Piotr
More information about the wine-devel
mailing list