All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Theodore Tso <tytso@mit.edu>, Jeff King <peff@peff.net>,
	Frank Lichtenheld <frank@lichtenheld.de>,
	Jim Meyering <jim@meyering.net>,
	git@vger.kernel.org
Subject: Re: [PATCH] Don't fflush(stdout) when it's not helpful
Date: Sat, 30 Jun 2007 11:42:09 -0700	[thread overview]
Message-ID: <7vbqexcmim.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <alpine.LFD.0.98.0706292114350.8675@woody.linux-foundation.org> (Linus Torvalds's message of "Fri, 29 Jun 2007 21:24:41 -0700 (PDT)")

Linus Torvalds <torvalds@linux-foundation.org> writes:

>> I was planning to push this out to 'master' this weekend.
>
> I think that code is fine, but switching the order around could probably 
> make it less likely that stdio loses the errno for us. 
>
> So doing the last part in a different order, and making it say
>
> 	/* Check for ENOSPC and EIO errors.. */
> 	if (fflush(stdout))
> 		die("write failure on standard output: %s", strerror(errno));
> 	if (ferror(stdout))
> 		die("unknown write failure on standard output");
> 	if (fclose(stdout))
> 		die("close failed on standard output: %s", strerror(errno));
> 	return 0;
>
> may recover at least non-transient errors.

That makes sense, to a certain degree, given that we do not
check every printf().  I'll forge your signature as usual ;-)

Thanks.

  parent reply	other threads:[~2007-06-30 18:42 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-25 20:32 [PATCH] git-rev-list: give better diagnostic for failed write Jim Meyering
2007-06-25 20:59 ` Linus Torvalds
2007-06-25 21:52   ` Jim Meyering
2007-06-25 22:20     ` Linus Torvalds
2007-06-25 22:56       ` Linus Torvalds
2007-06-25 23:01         ` Linus Torvalds
2007-06-27  8:56           ` Jim Meyering
2007-06-25 23:16         ` Linus Torvalds
2007-06-26 17:11           ` Theodore Tso
2007-06-26 17:32             ` Linus Torvalds
2007-06-26 22:04               ` Theodore Tso
2007-06-26 22:32                 ` Linus Torvalds
2007-06-28 19:04               ` Theodore Tso
2007-06-28 21:34                 ` Jeff King
2007-06-28 23:53                   ` [PATCH] Don't fflush(stdout) when it's not helpful Theodore Tso
2007-06-29  1:05                     ` Frank Lichtenheld
2007-06-29  3:48                       ` Theodore Tso
2007-06-29  6:38                         ` Jeff King
2007-06-29  7:07                           ` Junio C Hamano
2007-06-29 16:06                             ` Linus Torvalds
2007-06-29 17:40                               ` Theodore Tso
2007-06-29 23:43                                 ` Linus Torvalds
2007-06-30  2:15                                   ` Junio C Hamano
2007-06-30  4:24                                     ` Linus Torvalds
2007-06-30 14:27                                       ` Theodore Tso
2007-06-30 18:42                                       ` Junio C Hamano [this message]
2007-06-26  9:06         ` [PATCH] git-rev-list: give better diagnostic for failed write Jeff King
2007-06-26 17:12           ` Linus Torvalds
2007-06-27  8:59       ` Jim Meyering
2007-06-27 16:06         ` Linus Torvalds
2007-06-25 21:39 ` Jim Meyering
2007-06-25 21:53   ` Linus Torvalds
2007-06-25 22:08     ` Jim Meyering

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=7vbqexcmim.fsf@assigned-by-dhcp.cox.net \
    --to=gitster@pobox.com \
    --cc=frank@lichtenheld.de \
    --cc=git@vger.kernel.org \
    --cc=jim@meyering.net \
    --cc=peff@peff.net \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.