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

Re: [PATCH 1/1] fetch: fix deadlock when cleaning up lockfiles in async signals

From
Taylor Blau <me@ttaylorr.com>
Date
Jan 11, 2022, 02:11 UTC
Message-ID
<YdznSPJCSUQwVyg8@nand.local>
In-Reply-To
<2d8c1619-74ab-62b3-3a30-8e500a16649e@gmail.com>
On Sat, Jan 08, 2022 at 10:54:35AM +0000, Phillip Wood wrote:
Show 14 quoted lines
> > But is unlink() safe as-is? I'm not so sure. Reading signal-safety(7),
> > it's clearly on the list of functions that are OK to call. But reading
> > the errno section:
> >
> > (snip)
> >
> > We certainly not doing that, though that's nothing new, and so I wonder
> > why it doesn't seem to be an issue in practice.
>
> Because in this case we re-raise the signal and exit it does not matter if
> unlink() clobbers errno. If instead the program were to continue after
> handling the signal then we would have to save and restore errno to avoid
> interfering with the code that was running when the signal handler was
> called.
That makes perfect sense to me. Thanks for a clear explanation.
Taylor
Previous: Phillip Wood
Message 6 of 6 in “Async-signal safety in signal handlers”
  1. 0/1 Async-signal safety in signal handlersPatrick Steinhardt, Jan 7, 2022
  2. 1/1 fetch: fix deadlock when cleaning up lockfiles in async signalsPatrick Steinhardt, Jan 7, 2022
  3. brian m. carlsonJan 7, 2022
  4. Taylor BlauJan 7, 2022
  5. Phillip WoodJan 8, 2022
  6. Taylor BlauJan 11, 2022

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.