Hrvoje Niksic writes:
 SL Baur <steve(a)xemacs.org> writes:
 
 > Kyle Jones <kyle_jones(a)wonderworks.com> writes in xemacs-beta(a)xemacs.org:
 > 
 > > I think the patch introduces a descriptor leak.
 > 
 > Not according to my tests.
 
 I think you are right.
 
 Kyle, a question: if write() is failing, doesn't it mean that the
 descriptor is practically dead?  Does it really need explicit
 close()-ing? 
Yes.  Writing to a closed descriptor produces a return value of
-1 with errno set to EBADF on POSIX systems.  SIGPIPE is signaled
only when writing to an open pipe/socket descriptor whose reader
has closed the other end of the pipe (perhaps by exiting).
 [...]
 Also, I *would* like close() getting called on that fd eventually, no
 matter what. 
Me too.  It must be getting called somehow, if Steve isn't
seeing descriptor leakage.  But I certainly don't set how that
is happening, given that the closer method isn't called in
Lstream_close when the LSTREAM_FL_IS_OPEN flag bit is 0.