From: Junio C Hamano Date: Tue, 06 Dec 2005 08:11:57 GMT Subject: Re: [PATCH] Clean up compatibility definitions. Message-ID: <7vu0dm4pbm.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <81b0412b0512060007s589e1d0dr4f47da68a7f3567a@mail.gmail.com> Alex Riesen writes: > On 12/6/05, Junio C Hamano wrote: >> > ... return MAP_FAILED if error, do not >> > exit process, do no output. >> Ah, that is what you meant. I agree. > > now, while we agree, how about the patch removing "user interface" > from gitfakemmap altogether? > 311da12b7aaca9b7329a07807e1ce4afba4bff77 > diff --git a/compat/mmap.c b/compat/mmap.c > index 55cb120..32d7a30 100644 > --- a/compat/mmap.c > +++ b/compat/mmap.c > @@ -8,15 +8,17 @@ void *gitfakemmap(void *start, size_t le > { > int n = 0; > > - if (start != NULL || !(flags & MAP_PRIVATE)) > - die("Invalid usage of gitfakemmap."); > + if (start != NULL || !(flags & MAP_PRIVATE)) { > + errno = ENOTSUP; > + return MAP_FAILED; > + } I've considered this one after hearing what you meant by your previous comment, but I am slightly in favor of keeping this die(); what would trigger this is a programmer error, and the extra error message from die() makes it obvious, although I agree that it is unclean from purist point of view. On the other hand, > - start = xmalloc(length); > + start = malloc(length); This one I'd agree with 100%.