Use error code instead of errno