From: Junio C Hamano Date: Thu, 28 May 2015 21:11:55 GMT Subject: Re: [PATCH 4/4] config.c: rewrite ENODEV into EISDIR when mmap fails Message-ID: In-Reply-To: <20150528204436.GB29148@peff.net> Jeff King 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.