in reply to Re^10: Scoping question - will file handle be closed?
in thread Scoping question - will file handle be closed?

Hmm. You asked what could be done if a close fails and my suggestion was to at least notify the user that something bad has happened, which file is affected and maybe even provide a general idea what the problem is. At the very least that should help the user to provide the programmer with ~some~ useful information. (instead of crashing silently or simply turning a blind eye)

EBADF should be taken as a sign there's an actual bug. EINTR/EIO would enable the programmer to say: There's something fundamentally wrong with your system, don't bother me. The filename could help to figure out which filesystem / disk is having a problem and to perform a cross-check with the syslog if it has anything to say about it.

  • Comment on Re^11: Scoping question - will file handle be closed?