[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stable 2.0 and popen.test on Debian Squeeze
From: |
dsmich |
Subject: |
Re: Stable 2.0 and popen.test on Debian Squeeze |
Date: |
Tue, 1 Mar 2011 20:32:56 -0500 |
---- Mark H Weaver <address@hidden> wrote:
> Andy Wingo <address@hidden> writes:
> > The difference seems to be the difference between:
> >
> > dash -c 'exec 1>/dev/null; echo closed 1>&2; exec 2>/dev/null; read'
> >
> > and
> >
> > bash -c 'exec 1>/dev/null; echo closed 1>&2; exec 2>/dev/null; read'
> >
> > Dash prints "closed" and exits immediately with error code 2. Bash
> > prints "closed" and waits for input from the "read".
> >
> > Are we relying on non-portable shell behavior here?
>
> In dash, "read" requires at least one argument: the name of the variable
> in which to put the string. You don't see the error message because
> stderr has been redirected to /dev/null. In bash, the REPLY variable is
> used by default. So the "read" above ought to be changed to
> "read REPLY".
On my Debian Squeeze system:
address@hidden:~/src/guile$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Mar 1 20:26 /bin/sh -> dash
address@hidden:~/src/guile$ git diff
diff --git a/test-suite/tests/popen.test b/test-suite/tests/popen.test
index 6300c3b..9604c9c 100644
--- a/test-suite/tests/popen.test
+++ b/test-suite/tests/popen.test
@@ -104,7 +104,7 @@
(with-input-from-port (car p2c)
(lambda ()
(open-input-pipe
- "exec 1>/dev/null; echo closed 1>&2; exec
2>/dev/null; read")))))))
+ "exec 1>/dev/null; echo closed 1>&2; exec
2>/dev/null; read REPLY")))))))
(close-port (cdr c2p)) ;; write side
(let ((result (eof-object? (read-char port))))
(display "hello!\n" (cdr p2c))
address@hidden:~/src/guile$ ./check-guile popen.test
Testing /home/dsmith/src/guile/meta/guile ... popen.test
with GUILE_LOAD_PATH=/home/dsmith/src/guile/test-suite
Running popen.test
FAIL: popen.test: open-output-pipe: no duplicate
Totals for this test run:
passes: 14
failures: 1
unexpected passes: 0
expected failures: 0
unresolved test cases: 0
untested test cases: 0
unsupported test cases: 0
errors: 0
-Dale