2 ms·
"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 lo
by 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.