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

Re: [PATCH] Fix start_command closing cmd->out/in regardless of cmd->close_out/in

From
Ping Yin <pkufranky@gmail.com>
Date
Nov 21, 2007, 11:55 UTC
Message-ID
<46dff0320711210355icdbf634l258cf39c1582e8d4@mail.gmail.com>
In-Reply-To
<7vmyt8gdzv.fsf@gitster.siamese.dyndns.org>
On Nov 21, 2007 5:11 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> But I think an API definition that says "These fds are closed
> after the call, so if you are going to use them, you can dup()
> them beforehand" is equally valid, and I suspect that forgetting
> to dup() is easier to detect than forgetting to close() --- you
> will notice the former mistake immediately because your read and
> write say "oops, nobody on the other end" but the latter mistake
> will result in a hung process.  And for that reason, I think it
> can be called more "graceful".  So ...
>

I don't konw the original API definition and havn't found any API deinition that clarifies the fds will be closed after start_command. However, when i see child_process.close_in/close_out, i thought start_command will not close the fds.

I never said that start_command must not close fd. At least this behaviour of start_command makes child_process.close_in/close_out no sense.

>
>
-- 
Ping Yin
Previous: Junio C Hamano
Message 5 of 5 in “Fix start_command closing cmd->out/in regardless of cmd->close_out/in”
  1. Fix start_command closing cmd->out/in regardless of cmd->close_out/inPing Yin, Nov 19, 2007
  2. Johannes SixtNov 20, 2007
  3. Ping YinNov 21, 2007
  4. Junio C HamanoNov 21, 2007
  5. Ping YinNov 21, 2007

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.