Don't consult errno unless lookup fails.