in reply to Re^4: Handling sockets in a server
in thread Handling sockets in a server

I would think that either error return was equally valid from either.

  • In the case of EBADF, you probably don't care--you wanted it closed and it is--but it could be a useful indication of something wrong, a timing or logic error with your application. A warning to stderr or logfile might prove useful.
  • In the case of EINTR, it would mean that the process of clean up was interupted by an external signal, and therefore incomplete. The proper response would be to issue the close again, I think.

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.