4 ms·
>so would you return the error that triggered the cleanup, or the error that resulted from the cleanup? That's a good question. Fortunately, I don't do anythin
by mikevm 14y ago
>so would you return the error that triggered the cleanup, or the error that resulted from the cleanup?
That's a good question. Fortunately, I don't do anything complicated in the cleanup zone - mostly closing handles and freeing memory.
- betterunix 14y ago"Fortunately, I don't do anything complicated in the cleanup zone - mostly closing handles and freeing memory" Closing handles could cause an error! Take a look at the close manpage; there are three error conditions: * The argument is a bad file descriptor * The call was interrupted by a signal * An I/O error occurred while reading or writing Reading or writing? Yes, as it turns out, closing a handle may involve I/O to perform the last synchronization of the file. It sounds like you would ignore errors caused by closing the handle, and you would signal whatever error caused the cleanup to be entered.