Messages in this thread | | | Date | Thu, 13 Jul 2000 10:27:07 +0100 (GMT) | From | matt@theBachC ... | Subject | Re: SIGSEGV on fclose. |
| |
David Woodhouse wrote (on 13/07/00 10:05): >bbl@dk.damgaard.com said: >> in case you wonder: the problem arises from a program that closes a >> file twice because it does not know that the file is allready closed. > >Don't do that then. > >Read the man page: > ... any further access (including another call to fclose()) to > the stream results in undefined behaviour.
but his example fcloses a file which was not opened. This isn't "further access".
Is it difficult for Linux to spot the the file isn't open and return EBADF? What does POSIX have to say about this? IMHO making it easier to port your programs to Linux (and behaving a little more sanely :) is worth a couple of extra bytes of anyone's kernel.
Matt
- 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/
| |