git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nicolas Pitre <nico@cam.org>
Cc: Alex Riesen <raa.lkml@gmail.com>, git@vger.kernel.org
Subject: Re: 'git fast-export' is crashing on the gcc repo
Date: Wed, 12 Dec 2007 00:32:56 -0800	[thread overview]
Message-ID: <7v3au89utj.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LFD.0.99999.0712112045040.555@xanadu.home> (Nicolas Pitre's message of "Tue, 11 Dec 2007 20:45:40 -0500 (EST)")

Nicolas Pitre <nico@cam.org> writes:

> On Wed, 12 Dec 2007, Alex Riesen wrote:
>
>> Nicolas Pitre, Tue, Dec 11, 2007 23:06:42 +0100:
>> > 
>> > Well, ignore the above.  It seems that most of stdio doesn't set errno 
>> > so the above is crap.
>> > 
>> 
>> Well, it had no reason to in this case. It's not an error.
>> It does not even have to do a syscall.
>
> Which is why I later agreed with your patch.

Still, I like your swapping of size and nmemb parameters, regardless of
the "don't bother calling fwrite(3) if size is zero" fix.

We are writing 1 element of size n-byte and expecting the call to return
1.  It may be argued that writing one element of size 0-byte should
always write 1 element (without actually having to go down to write(2),
obviously) successfully and returning 0 from fwrite(3) is a bug ;-)

No, I am just kidding.  I checked with POSIX and it clearly says it
should return 0 if size or nmemb is zero.

  reply	other threads:[~2007-12-12  8:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-11 20:27 'git fast-export' is crashing on the gcc repo Nicolas Pitre
2007-12-11 20:35 ` Marco Costalba
2007-12-11 22:01 ` [PATCH] Fix git-fast-export for zero-sized blobs Alex Riesen
2007-12-11 22:20   ` Nicolas Pitre
2007-12-11 22:06 ` 'git fast-export' is crashing on the gcc repo Nicolas Pitre
2007-12-12  1:38   ` Alex Riesen
2007-12-12  1:45     ` Nicolas Pitre
2007-12-12  8:32       ` Junio C Hamano [this message]
2007-12-12  8:46         ` David Kastrup
2007-12-12  8:56           ` Junio C Hamano

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

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

  git send-email \
    --in-reply-to=7v3au89utj.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=nico@cam.org \
    --cc=raa.lkml@gmail.com \
    /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.
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 NNTP newsgroup(s).