X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 	tests=AWL,BAYES_00,FB_WORD1_END_DOLLAR,RCVD_IN_DNSWL_LOW,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <4A8D7A1D.9040605@cwilson.fastmail.fm>
Date: Thu, 20 Aug 2009 12:30:21 -0400
From: Charles Wilson <cygwin@cwilson.fastmail.fm>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.22) Gecko/20090605 Thunderbird/2.0.0.22 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] Updated: run-1.1.11-1
References: <200908171705.n7HH5TYe024203@StraightRunning.com>  <4A89A490.1050108@cwilson.fastmail.fm>  <4A8D429A.1070306@byu.net>  <4A8D4B6A.9080706@gmail.com> <20090820143940.GA13570@ednor.casa.cgf.cx> <4A8D6510.1050309@gmail.com>
In-Reply-To: <4A8D6510.1050309@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

This is all very interesting, and responds to a question that I raised
-- but it's been overcome by events.  In run-1.1.12, we no longer care
whether the current process's (that is, run's) GetStdHandles are from a
 console or not -- not even in commented-out code.

Instead, we care whether the current process HAS a console at all. If it
does, then we [++] open new inheritable handles to CONIN$ and CONOUT$,
and pass those to the child.

This means that 'run foo >/dev/null' (that is, redirecting run's stdout
to /dev/null, and expecting foo's stdout to also be redirected) -- but I
don't think it worked in the past anyway.  Instead, what now happens is
foo's stdout will unconditionally go to the CONOUT$ of the (hidden)
console.  (same deal with 'run foo >somefile' -- but again, I don't
think that ever worked before).

So, what's the effective difference between sending foo's output to
/dev/null, and sending it to a hidden console? In both cases it never
blocks, and is always writable (in the latter case, because the
console's message handler always drains the queue).

However, I appreciate all the info. If there are problems with
run-1.1.12, then maybe [++] is the place to add in an additional check
concerning the handles returned by GetStdHandle(), using code similar to
the ideas expressed in this subthread.

--
Chuck

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

