But you could omit the last `errno = 0` since you stop everything if errno is not zero inside the for.