Re: [PATCH] git-rev-list: give better diagnostic for failed write
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Jun 25, 2007, 23:01 UTC
- Message-ID
- <alpine.LFD.0.98.0706251557090.8675@woody.linux-foundation.org>
- In-Reply-To
- <alpine.LFD.0.98.0706251536240.8675@woody.linux-foundation.org>
On Mon, 25 Jun 2007, Linus Torvalds wrote:
> > Actually, even this is really nasty, and it's a case where the current > "git.c" code can also fail.
Just to clarify: this is why the git.c code obviously does the fstat(), in case anybody wondered.
So I didn't mean to imply that the new git.c code in 'next' is wrong, I just meant to imply that the "ferror()"+"fflush()" sequence that it uses and that I copied for my example is a very unreliable sequence, and it basically fails exactly because you can never know what caused the ferror() to trigger - if it *ever* triggers, you're basically screwed.
I wonder how many applications actually ever use ferror() and friends.
Linus