git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: Re: [PATCH] Clean up compatibility definitions.
Date: Tue, 06 Dec 2005 00:11:57 -0800	[thread overview]
Message-ID: <7vu0dm4pbm.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <81b0412b0512060007s589e1d0dr4f47da68a7f3567a@mail.gmail.com> (Alex Riesen's message of "Tue, 6 Dec 2005 09:07:04 +0100")

Alex Riesen <raa.lkml@gmail.com> writes:

> On 12/6/05, Junio C Hamano <junkio@cox.net> 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%.

  reply	other threads:[~2005-12-06  8:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-05 13:19 make gitfakemmap standalone to fix linking error in git.c Alex Riesen
2005-12-05 13:24 ` Alex Riesen
2005-12-05 14:11   ` Petr Baudis
2005-12-05 15:43     ` Alex Riesen
2005-12-05 17:40   ` Junio C Hamano
2005-12-05 20:22     ` [PATCH] Clean up compatibility definitions Junio C Hamano
2005-12-05 20:36       ` Johannes Schindelin
2005-12-05 20:51         ` Junio C Hamano
2005-12-05 21:39           ` Alex Riesen
2005-12-06  7:35             ` Alex Riesen
2005-12-06  7:58               ` Junio C Hamano
2005-12-05 21:50       ` Alex Riesen
2005-12-05 21:58         ` Junio C Hamano
2005-12-06  7:15           ` Alex Riesen
2005-12-06  7:31             ` Junio C Hamano
2005-12-06  8:07               ` Alex Riesen
2005-12-06  8:11                 ` Junio C Hamano [this message]
2005-12-05 23:12       ` Petr Baudis
2005-12-06  3:17         ` Junio C Hamano
2005-12-06  9:53           ` Petr Baudis
2005-12-05 21:36     ` make gitfakemmap standalone to fix linking error in git.c Alex Riesen
2005-12-05 21:49       ` Junio C Hamano
2005-12-06  7:49         ` Alex Riesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vu0dm4pbm.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).