Re: [PATCH 4/4] config.c: rewrite ENODEV into EISDIR when mmap fails
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 28, 2015, 21:11 UTC
- Message-ID
- <xmqqr3q0flus.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150528204436.GB29148@peff.net>
Jeff King <peff@peff.net> writes:
Show 5 quoted lines
> 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.