[OT] Re: fopen(NULL) causes segmentation fault

Mo McKinlay mmckinlay@labs.interopen.org
Tue Mar 28 10:55:00 GMT 2000


# Shouldn't fclose set errno to EBADF and then return? From the man
# page:

#        EBADF  The argument stream is not an open stream.

Possibly, although at a guess EBADF is returned when the file descriptor
that the stream points to has already been closed, as opposed to the FILE
pointer being invalid. (i.e., EBADF is returned by the underlying
close() call). I've not looked at the specs/docs in huge detail, so I
could well be wrong.

In either case, it's still not a gcc issue :-)

Mo.

-- 
Mo McKinlay             Chief Software Architect              inter/open
mmckinlay@labs.interopen.org                    http://www.interopen.org



More information about the Gcc-bugs mailing list