Hi list,
If one calls CLOSE on a fd-stream that has pending output, but that
cannot do output any longer (such as a socket that has been closed by
the other side), close will fail with an error and, obviously, not close
the file descriptor. It does work when calling CLOSE with :ABORT T,
however.
I'm just wondering whether this is intended behavior. If one wants a
socket closed, normally closing it nicely but ignoring any errors, the
idiom one must use, in that case, is
(handler-case (close stream) (error () (close stream :abort t)))
which seems a bit cumbersome to use as the normal case.
--
Fredrik Tolf
|