Re: [PATCH] Fix start_command() pipe bug when stdin is closed.
- From
- Karl Chen <quarl@cs.berkeley.edu>
- Date
- Aug 25, 2008, 15:56 UTC
- Message-ID
- <quack.20080825T0856.lth63ppulyu@roar.cs.berkeley.edu>
- In-Reply-To
- <48B28CF8.2060306@viscovery.net>
>>>>> On 2008-08-25 03:44 PDT, Johannes Sixt writes:
Johannes> When I try these instructions I don't get an error;
Johannes> instead the command runs successfully.Weird. I see the symptom on two machines, both 1.5.6 and tracking master. The 1.5.6 system installation could be interfering even though I used PATH=/path/to/git:$PATH.
Johannes> While I do see that there is a problem, it is only
Johannes> half of the story, and your patch addresses only
Johannes> this half. Johannes> What if stdout is closed, too? Then the ends of the
Johannes> first allocated pipe would go to fds 0 and 1, and
Johannes> then the pipe end at 1 would be closed by a
Johannes> subsequent dup2(xxx, 1).My patch was intended to fix the problem for any renaming where fd_from==fd_to, including target stdout. I didn't say so in the changelog though.