Originally Posted by
nonoob
Normally you should only check errno if something went wrong... like a function returned:
fopen() returned a NULL
fwrite() returned a count written which was not what was intended
rename() returned non zero
mkdir() return non zero
... and deal with the consequences right then. Not after a function was completed. The way I do it anyhow.