Fixed wrong cut'n'pasted errno check.