Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: test output pattern matching



On Fri, 2 Dec 2011 18:03:56 +0100
<ports@xxxxxxxxxxxx> wrote:
> ./A04redirect.ztst: starting.
> *** /usr/ports/pobj/zsh-4.3.13/zsh-4.3.13/tmp.ztst.err.6420     Fri Dec  2 17:58:33 2011
> --- /usr/ports/pobj/zsh-4.3.13/zsh-4.3.13/tmp.ztst.terr.6420    Fri Dec  2 17:58:33 2011
> ***************
> *** 1 ****
> - (eval):1: failed to close file descriptor 3: bad file descriptor
> --- 0 ----

That might mean file descriptor 3 is open, so closing it didn't
fail.  What we could do is ensure it's closed, ignoring the status and
error output, then try to close it again.

Index: Test/A04redirect.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/A04redirect.ztst,v
retrieving revision 1.22
diff -p -u -r1.22 A04redirect.ztst
--- Test/A04redirect.ztst	1 Dec 2011 21:52:55 -0000	1.22
+++ Test/A04redirect.ztst	2 Dec 2011 17:22:56 -0000
@@ -152,10 +152,11 @@
 >hello
 >goodbye
 
-  (exec 3<&-
+  ({ exec 3<&- } 2>/dev/null
+  exec 3<&-
   read foo <&-)
 1:'<&-' redirection
-*?\(eval\):1: failed to close file descriptor 3:*
+*?\(eval\):*: failed to close file descriptor 3:*
 
   print foo >&-
 0:'>&-' redirection

-- 
Peter Stephenson <pws@xxxxxxx>            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
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog



Messages sorted by: Reverse Date, Date, Thread, Author