From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18856 invoked by alias); 17 Sep 2010 09:35:50 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28266 Received: (qmail 22055 invoked from network); 17 Sep 2010 09:35:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Fri, 17 Sep 2010 09:46:10 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: PATCH: coprocess descriptor and error messages Message-ID: <20100917094610.390f120f@pwslap01u.europe.root.pri> In-Reply-To: <100916220444.ZM30547@torch.brasslantern.com> References: <100916220444.ZM30547@torch.brasslantern.com> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.6 (GTK+ 2.18.9; i686-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 17 Sep 2010 08:46:10.0876 (UTC) FILETIME=[C7209FC0:01CB5644] X-Scanned-By: MailControl A-10-90-03 (www.mailcontrol.com) on 10.68.0.135 On Thu, 16 Sep 2010 22:04:42 -0700 Bart Schaefer wrote: > This seems somehow wrong to me ... starting from "zsh -f": > > torch% print -p ; echo $? > print: bad file number: -1 > 1 > torch% read -p ; echo $? > 1 > > Seems to me that both commands should either fail silently, or print a > more specific error. Patch below does the former. (Line numbers may > be off.) I won't commit until I see commentary. The question is whether it's useful to be able to test whether the coprocess is open at the same time as attempting to read or write. If so, doing it silently is reasonable. Otherwise it might be less mysterious to print "coprocess not open", or something like that, in both cases. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom