git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5] gc: ignore old gc.log files

From
Jeff King <peff@peff.net>
Date
Feb 10, 2017, 21:32 UTC
Message-ID
<20170210213227.wviuppcqb42kk3ww@sigill.intra.peff.net>
In-Reply-To
<069b229470204235b7155b33da52421c@exmbdft7.ad.twosigma.com>
On Fri, Feb 10, 2017 at 09:23:15PM +0000, David Turner wrote:
Show 7 quoted lines
> > Speaking of stderr, I wonder if this function should be calling
> > fflush(stderr) before looking at the fstat result. There could be contents buffered
> > there that haven't been written out yet (not from child processes, but perhaps
> > ones written in this process itself).
> > Probably unlikely in practice, since stderr is typically unbuffered by default.
> 
> Process_log_file_at_exit calls fflush.  Will fix the other.

Ah, good. That makes sense, since we might deadlock if we do it in a signal handler. Perhaps that is a reason not to use stderr here again (though if we want to be that careful, a new fdopen() call is also a bad idea, as we can deadlock over the malloc() lock; you'd have to snprintf to a small buffer and dump it with write()).

-Peff
Previous: David Turner
Message 4 of 4 in “gc: ignore old gc.log files”
  1. gc: ignore old gc.log filesDavid Turner, Feb 10, 2017
  2. Jeff KingFeb 10, 2017
  3. David TurnerFeb 10, 2017
  4. Jeff KingFeb 10, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.