rely less on a value in errno to indicate whether the error happened