Follow-up Comment #1, bug #20495 (project make):
There seems to be a change within the Microsoft Visual C++ Runtime between
Microsoft Visual Studio .NET (aka 2002) and Microsoft Visual Studio 2005. I
have no access to Microsoft Visual Studio 2003 so I can't prove if this
behavior was introduced earlier.
Microsoft Visual Studio .NETVc7crtsrcclose.c
/* validate file handle */
if ( ((unsigned)fh >= (unsigned)_nhandle) ||
!(_osfile(fh) & FOPEN) )
{
/* bad file handle, set errno and abort */
errno = EBADF;
_doserrno = 0;
return -1;
}
Microsoft Visual Studio 8VCcrtsrcclose.c
/* validate file handle */
_CHECK_FH_CLEAR_OSSERR_RETURN( fh, EBADF, -1 );
_VALIDATE_CLEAR_OSSERR_RETURN((fh >= 0 && (unsigned)fh < (unsigned)_nhandle),
EBADF, -1);
_VALIDATE_CLEAR_OSSERR_RETURN((_osfile(fh) & FOPEN), EBADF, -1);
Anyway, closing the file handle -1 is definitely a bug, which was ignored by
earlier versions of the Microsoft libraries (in fact it was reported by the
return code of close() which is *explicitly* ignored by the caller within
function.c).
Regards, Stefan
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?20495>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-make