Subject: Re: [PATCH 4/4] config.c: rewrite ENODEV into EISDIR when mmap fails

From: Junio C Hamano <[email-masked]>
Date: Thu, 28 May 2015 14:11:55 -0700

Jeff King <[email-masked]> writes:

> We also know S_ISDIR(st.st_mode) _before_ we actually mmap. So I was
> tempted to simply check it beforehand, under the assumption that the
> mmap cannot possibly work if we have a directory. But by doing it in the
> error code path, then we _know_ we are not affecting the outcome, only
> the error message. :)

Well, even if your mmap() worked on a directory, having ~/.gitconfig
as a directory is wrong in the first place, so...

I think what you sent is good as-is, so let's go with them.