Messages in this thread | | | Date | Sat, 15 Jul 2000 14:09:36 +0200 | From | Andries Brouwer <> | Subject | Re: Closing the FILE object. |
| |
On Fri, Jul 14, 2000 at 01:25:06PM -0400, Richard B. Johnson wrote:
> This is in reference to the reported seg-faults when attempting to > fclose() an invalid file pointer. > > The following shows that my current 'C' runtime library does not > adhere to any known standard when referencing the FILE object during > fclose(). This is gcc 2.7.2.3 (libc 5.3.12)
No, it does not show that. It shows that you misinterpreted the wording of the man page. I adapted the wording a bit to make things clearer, if possible.
EBADF The filedescriptor underlying stream is not valid.
In your case the stream itself is not a stream at all, and random things may happen. You can get the EBADF error by doing close(fileno(fp)) first.
Andries
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |