public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "Shawn O. Pearce" <spearce@spearce•org>
Cc: Johannes Sixt <johannes.sixt@telecom•at>, git@vger•kernel.org
Subject: Re: [PATCH] start_command(), if .in/.out > 0, closes file descriptors, not the callers
Date: Sun, 17 Feb 2008 00:07:34 -0800	[thread overview]
Message-ID: <7vodag2egp.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080217074252.GO24004@spearce.org> (Shawn O. Pearce's message of "Sun, 17 Feb 2008 02:42:52 -0500")

"Shawn O. Pearce" <spearce@spearce•org> writes:

> Of course the same argument can be said for fd 0; if the parent does
> close(0) before some other open/socket/pipe call then its obviously
> possible for the parent to get a fd that it wants the child to take
> over and close.
>
> We're basically assuming that the parent will always keep its
> own stdin open if it will be spawning children.  We all know what
> happens when we assume (we double close file descriptors) but I
> think its a reasonable safe assumption to be making.

Ok, that unwritten assumption was what confused me.  We
definitely need Documentation/technical/api-*.txt before any
more code, don't you agree?

  reply	other threads:[~2008-02-17  8:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14  6:22 [PATCH 2/6] Automatically close stderr pipes created by run_command Shawn O. Pearce
2008-02-14  8:00 ` Johannes Sixt
2008-02-15 17:11   ` Junio C Hamano
2008-02-15 19:45     ` Johannes Sixt
2008-02-15 22:14       ` Junio C Hamano
2008-02-16 17:36         ` [PATCH] start_command(), .in/.out/.err = -1: Callers must close the file descriptor Johannes Sixt
2008-02-16 17:36           ` [PATCH] start_command(), if .in/.out > 0, closes file descriptors, not the callers Johannes Sixt
2008-02-16 22:55             ` Junio C Hamano
2008-02-17  7:42               ` Shawn O. Pearce
2008-02-17  8:07                 ` Junio C Hamano [this message]
2008-02-17  8:20                   ` Shawn O. Pearce
2008-02-17  9:29               ` Johannes Sixt
2008-02-21 22:42                 ` [PATCH v2] " Johannes Sixt
2008-02-22  1:17                   ` Junio C Hamano
2008-02-16  8:25   ` [PATCH 2/6] Automatically close stderr pipes created by run_command Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vodag2egp.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=johannes.sixt@telecom$(echo .)at \
    --cc=spearce@spearce$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox