X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,TW_MK,TW_YG,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <4C65AA3A.70303@redhat.com> References: <00c301cb3b22$ae416800$0ac43800$@gmail.com> <4C65A83F DOT 4010608 AT redhat DOT com> <4C65AA3A DOT 70303 AT redhat DOT com> Date: Fri, 13 Aug 2010 13:44:51 -0700 Message-ID: Subject: Re: Broken process substitution From: Daniel Colascione To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Fri, Aug 13, 2010 at 1:25 PM, Eric Blake wrote: > Then again, cat should exist until something causes the input side of > its pipe to declare EOF; so I guess there's no race in this example > after all. =A0Rather, it looks like a limitation in cygwin1.dll. =A0I don= 't > know why bash is unable to duplicate the output end of the pipe to the > echo process, unless cygwin's /dev/fd handling doesn't work on pipes. > But that's highly likely that you are dealing with yet another one of > cygwin's pipe handling shortfalls. Would these shortfalls also explain why this script doesn't do what I'd expect (that is, output "hello" and exit)? It just hangs right now --- this is the ps output: I 8580 7740 7740 6340 3 4412345 13:41:41 /usr/bin/cygpath I 7724 7740 7740 4796 3 4412345 13:41:41 /usr/bin/cygpath O 1736 7740 7740 8796 3 4412345 13:41:41 /usr/bin/echo So, err, echo is waiting to output, and cygpath is waiting to receive input? I don't see why the script shouldn't be making forward progress. #!/bin/bash tmpdir=3D$(mktemp -dt cygfilter-XXXXXX) stdout_pid=3D stderr_pid=3D function cleanup() { [[ -n $stdout_pid ]] && /bin/kill $stdout_pid [[ -n $stderr_pid ]] && /bin/kill $stderr_pid rm -rf "$tmpdir" } trap cleanup 0 mkfifo "$tmpdir/f-out" mkfifo "$tmpdir/f-err" cygpath -u -f "$tmpdir/f-out"& stdout_pid=3D$! disown %% cygpath -u -f "$tmpdir/f-err" >&2 & stderr_pid=3D$! disown %% "$@" >"$tmpdir/f-out" 2>"$tmpdir/f-err" # Run as cygfilter /bin/echo hello # ----------- -- 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