git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-rev-list: give better diagnostic for failed write
@ 2007-06-25 20:32 Jim Meyering
  2007-06-25 20:59 ` Linus Torvalds
  2007-06-25 21:39 ` Jim Meyering
  0 siblings, 2 replies; 33+ messages in thread
From: Jim Meyering @ 2007-06-25 20:32 UTC (permalink / raw)
  To: git

[this patch depends on the one I posted here:
 http://marc.info/?l=git&m=118280134031923&w=2 ]

Without this patch, git-rev-list unnecessarily omits strerror(errno)
from its diagnostic, upon write failure:

    $ ./git-rev-list --max-count=1 HEAD > /dev/full
    fatal: write failure on standard output

With the patch, git reports the desired ENOSPC diagnostic:

    fatal: write failure on standard output: No space left on device

* builtin-rev-list (show_commit): Don't fflush stdout here.
Instead, let the fclose in main do it, so there's a better
chance the underlying cause (errno) will be reported.

Signed-off-by: Jim Meyering <jim@meyering.net>
---
 builtin-rev-list.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 813aadf..62f0ba9 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -100,7 +100,6 @@ static void show_commit(struct commit *commit)
 		printf("%s%c", buf, hdr_termination);
 		free(buf);
 	}
-	fflush(stdout);
 	if (commit->parents) {
 		free_commit_list(commit->parents);
 		commit->parents = NULL;

^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2007-06-30 18:42 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).