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

Re: [PATCH 2/2] Use xmmap_gently instead of xmmap in use_pack

From
Jeff King <peff@peff.net>
Date
May 16, 2019, 03:34 UTC
Message-ID
<20190516033422.GD4596@sigill.intra.peff.net>
In-Reply-To
<20190516003736.25544-2-mh@glandium.org>
On Thu, May 16, 2019 at 09:37:36AM +0900, Mike Hommey wrote:
> use_pack has its own error message on mmap error, but it can't be
> reached when using xmmap, which dies with its own error.

Makes sense. Amusingly this xmmap comes from c4712e4553 (Replace mmap with xmmap, better handling MAP_FAILED., 2006-12-24), which specifically moved everything to xmmap for its error handling, and dropped all of the MAP_FAILED checks. But it forgot to remove this one.

So we could also go the other way, and just remove the unreachable check. I do think the error from use_pack() is better though, so I like the direction you went.

-Peff
Previous: Mike HommeyNext: Jeff King
Message 4 of 5 in “Re: Closing fds twice when using remote helpers”
  1. Mike HommeyMay 16, 2019
  2. 1/2 dup() the input fd for fast-import used for remote helpersMike Hommey, May 16, 2019
  3. 2/2 Use xmmap_gently instead of xmmap in use_packMike Hommey, May 16, 2019
  4. Jeff KingMay 16, 2019
  5. Jeff KingMay 16, 2019

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.