fclose should return EOF (-1) if an error condition exists.
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index 925e584..c0c4915 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c
@@ -1195,7 +1195,9 @@ */ int MSVCRT_fclose(MSVCRT_FILE* file) { - return _close(file->_file); + int r; + r=_close(file->_file); + return ((r==MSVCRT_EOF) || (file->_flag & _IOERR) ? MSVCRT_EOF : 0); } /*********************************************************************