Consistent return code and errno