]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
tests: make redirects happen in correct order
authorWei Jiangang <weijg.fnst@cn.fujitsu.com>
Wed, 14 Oct 2015 10:39:13 +0000 (18:39 +0800)
committerAndrea Bolognani <abologna@redhat.com>
Wed, 14 Oct 2015 11:10:38 +0000 (13:10 +0200)
It should redirect stdout to /dev/null first,
then redirect stderr to whatever stdout currently points at.

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
tests/test-lib.sh

index e612f8f215c2239e07891c9d59155d9cfbae2618..aff179c7929dbd5553275bfa4097e9c013c74eb0 100644 (file)
@@ -248,9 +248,9 @@ trap '(exit $?); exit $?' 1 2 13 15
 
 cd "$t_" || error_ "failed to cd to $t_"
 
-if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
+if ( diff --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
   compare() { diff -u "$@"; }
-elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
+elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
   compare() { cmp -s "$@"; }
 else
   compare() { cmp "$@"; }