I prefer to not use else cases after conditions that return, especially when it's a failure case. We don't put the rest of this function in the else condition for !S_ISDIR(st.st_mode), for example.