|
From: | Bryan W. Headley |
Subject: | Re: fclose bug? |
Date: | Mon, 04 Mar 2002 10:49:04 -0600 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020214 |
Ulrich Drepper wrote:
Jason Merrill <address@hidden> writes:This testcase segfaults with the Red Hat glibc-2.2.4-19.3 rpm. AFAICT, the second fclose should detect the error and return EOF rather than crashing.No. If a file descriptor is closed it no file descriptor anymore. The runtime library is not there to catch the programmers bugs.
Oh, I love this argument. :-)We should bzero the contents of FILE* on fclose, and return lovely documented error if told to fclose FILE* again. Why? Because API does not document segfault behavior :-)
-- ____ .:. ____ Bryan W. Headley - address@hidden
[Prev in Thread] | Current Thread | [Next in Thread] |