diff --git a/git.c b/git.c index c65e52f3db..cfec5d70ee 100644 --- a/git.c +++ b/git.c @@ -251,11 +251,12 @@ static int run_command(struct cmd_struct *p, int argc, const char **argv) return 0; /* Check for ENOSPC and EIO errors.. */ - if (ferror(stdout)) - die("write failure on standard output"); - if (fflush(stdout) || fclose(stdout)) + 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; }