[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] init.sh: don't waste a subshell just to redirect stderr
From: |
Eric Blake |
Subject: |
Re: [PATCH] init.sh: don't waste a subshell just to redirect stderr |
Date: |
Thu, 05 Jan 2012 09:46:15 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 |
On 01/05/2012 09:36 AM, Stefano Lattarini wrote:
>> +++ b/tests/init.sh
>> @@ -255,7 +255,7 @@ compare_dev_null_ ()
>> return 2
>> }
>>
>> -if diff_out_=`( diff -u "$0" "$0" < /dev/null ) 2>/dev/null`; then
>> +if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null`; then
>>
> Wouldn't it be simpler and better to leave that redirection out altogether?
> The output of the test scripts should be redirected to `.log' files by the
> testsuite harness, so by being more verbose we can make those files more
> informative, all without cluttering the make output.
In the case of coreutils, yes. But in the case of ./gnulib-tool
--with-tests --test ..., for running gnulib unit tests, there is nothing
capturing the stderr, so it leaks to the output.
I agree with Jim's change - init.sh is used in too many other places to
blindly state that leaking stderr to all those places is reasonable, and
that init.sh should be silent instead.
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
Re: [PATCH] init.sh: don't waste a subshell just to redirect stderr, Jim Meyering, 2012/01/05