Re: [PATCH] start_command(), if .in/.out > 0, closes file descriptors, not the callers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> wrote:
> "Shawn O. Pearce" <spearce@xxxxxxxxxxx> 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?

Yes.

I'm far too tired to write it tonight.  Maybe I will find the
time and energy tomorrow.  Depends on how it goes at day-job
(yes, must go back for yet another day this weekend).

But this API is messy enough that we need explicit rules of
how it should be used, and then make everyone match that.

Unless Johannes Sixt beats me to it, my next patch to you will
be for a proposed documentation improvement.

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux