Jeff King <peff@xxxxxxxx> writes: > On Thu, Jun 28, 2007 at 11:48:38PM -0400, Theodore Tso wrote: > >> +void maybe_flush_or_die(FILE *f, const char *desc) >> +{ >> + static int stdout_is_file = -1; >> + struct stat st; >> + char *cp; >> + >> + if (f == stdout) { >> + if (stdout_is_file < 0) { >> + cp = getenv("GIT_FLUSH"); >> + if (cp) >> + stdout_is_file = (atoi(cp) == 0); >> + else if ((fstat(fileno(stdout), &st) == 0) && >> + S_ISREG(st.st_mode)) >> + stdout_is_file = 1; >> ... > > Looks much better to me, but I have one minor nit: stdout_is_file is a > poor name,... Thanks for bringing it up, as I had the same "Huh?" moment. I would probably call that simply "do_not_flush". Or name the variable "flush_stdout" and swap all the logic. if (f == stdout) { if (flush_stdout < 0) { cp = getenv("GIT_FLUSH_STDOUT"); if (cp) flush_stdout = !!atoi(cp); else if ((fstat(fileno(stdout), &st) == 0) && !S_ISREG(st.st_mode)) flush_stdout = 0; else flush_stdout = 1; } if (!flush_stdout) return; } - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html