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

Re: [PATCH] wrapper: add workaround for open() returning EINTR

From
Jeff King <peff@peff.net>
Date
Feb 24, 2021, 18:23 UTC
Message-ID
<YDaZtqRvdZWkyQVp@coredump.intra.peff.net>
In-Reply-To
<acb282ee-fc55-bbe0-8272-087bde180ea2@kdbg.org>
On Wed, Feb 24, 2021 at 08:20:57AM +0100, Johannes Sixt wrote:
Show 12 quoted lines
> Am 24.02.21 um 05:43 schrieb Jeff King:
> > The workaround here is enabled all the time, without a Makefile knob,
> > since it's a complete noop if open() never returns EINTR. I did push it
> > into its own compat/ source file, though, since it has to #undef our
> > macro redirection. Putting it in a file with other code risks confusion
> > if more code is added after that #undef.
> 
> I'm not so much opposed to "enable it all the time" in general, but when
> we already have an override of open(), like for the Windows case in
> compat/mingw.h, I find it a bit rough to put another wrapper around it,
> even more so since we won't have the EINTR problem on Windows due to the
> absence of signals.

That's fair. I don't think my new wrapper would interact well with mingw_open(). They are both trying to #define open. I think since mine comes later in git-compat-util.h, it is probably overriding mingw_open() completely on Windows, which is quite bad (we call into my function in wrapper.c, but then its "#undef open" means we get the original open(), not the previously defined wrapper).

-Peff
Previous: Johannes SixtNext: Jeff King
Message 14 of 15 in “wrapper: add workaround for open() returning EINTR”
  1. wrapper: add workaround for open() returning EINTRJeff King, Feb 24, 2021
  2. Jeff KingFeb 24, 2021
  3. Junio C HamanoFeb 24, 2021
  4. Jeff KingFeb 24, 2021
  5. Makefile: add OPEN_RETURNS_EINTR knobJeff King, Feb 26, 2021
  6. Junio C HamanoFeb 26, 2021
  7. config.mak.uname: enable OPEN_RETURNS_EINTR for macOS Big SurJeff King, Mar 1, 2021
  8. Junio C HamanoMar 1, 2021
  9. Junio C HamanoMar 1, 2021
  10. Jeff KingMar 3, 2021
  11. Junio C HamanoMar 4, 2021
  12. Taylor BlauFeb 24, 2021
  13. Johannes SixtFeb 24, 2021
  14. Jeff KingFeb 24, 2021
  15. Jeff KingFeb 26, 2021

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.