fclose should return EOF (-1) if an error condition exists.

This commit is contained in:
Francois Gouget 2001-05-31 21:33:32 +00:00 committed by Alexandre Julliard
parent 30a3d18a32
commit b6dc0940c2
1 changed files with 3 additions and 1 deletions

View File

@ -1195,7 +1195,9 @@ void MSVCRT_clearerr(MSVCRT_FILE* file)
*/
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);
}
/*********************************************************************