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

Re: [PATCHv2] run-command: detect finished children by closed pipe rather than waitpid

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 20, 2015, 22:05 UTC
Message-ID
<20151120220544.GC18255@google.com>
In-Reply-To
<1448053719-28340-1-git-send-email-sbeller@google.com>
Stefan Beller wrote:
> Detect if a child stopped working by checking if their stderr pipe
> was closed instead of checking their state with waitpid.
> As waitpid is not fully working in Windows, this is an approach which
> allows for better cross platform operation. (It's less code, too)
Can you say more about what is broken about waitpid on Windows?

I ask because it's possible for a child to close stderr without intending to be finished. That might be okay here (though the commit subject doesn't explain so, it is only affecting the workqueue interface that runs commands in parallel and not the normal run-command interface) but would need some documentation and could be counterintuitive.

So if there's a simple way to get waitpid to work, that seems preferrable.

Thanks, Jonathan

Previous: Stefan BellerNext: Johannes Sixt
Message 2 of 6 in “[PATCHv2] run-command: detect finished children by closed pipe rather than waitpid”
  1. Stefan BellerNov 20, 2015
  2. Jonathan NiederNov 20, 2015
  3. Johannes SixtNov 20, 2015
  4. Torsten BögershausenNov 21, 2015
  5. Stefan BellerNov 23, 2015
  6. Stefan BellerNov 23, 2015

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.