[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFT] Remove three forks per _AC_RUN_LOG_STDERR
From: |
Ralf Wildenhues |
Subject: |
Re: [RFT] Remove three forks per _AC_RUN_LOG_STDERR |
Date: |
Thu, 6 Nov 2008 14:03:47 +0100 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
Hi Paolo,
* Paolo Bonzini wrote on Thu, Nov 06, 2008 at 11:28:29AM CET:
> --- a/lib/autoconf/general.m4
> +++ b/lib/autoconf/general.m4
> @@ -2253,11 +2253,13 @@ AC_DEFUN([_AC_RUN_LOG],
> # in AS_IF constructs.
> AC_DEFUN([_AC_RUN_LOG_STDERR],
> [{ { $2; } >&AS_MESSAGE_LOG_FD
> - ($1) 2>conftest.er1
> + ($1) 2>conftest.err
Why not 2>conftest.er1 and ...
> ac_status=$?
> - grep -v '^ *+' conftest.er1 >conftest.err
> - rm -f conftest.er1
> - cat conftest.err >&AS_MESSAGE_LOG_FD
> + if test -s conftest.err; then
> + grep -v '^ *+' conftest.err >conftest.er1
> + cat conftest.er1 >&AS_MESSAGE_LOG_FD
... putting an
else
: >conftest.err
here (and adjusting the rest of the code) and saving an added fork (the
mv) in the nonempty-warning case, at the expense of more file operations
in the empty case. Otherwise, ...
> + mv conftest.er1 conftest.err
... this needs to be 'mv -f'.
> + fi
> _AS_ECHO_LOG([\$? = $ac_status])
> test $ac_status = 0; }])
Cheers,
Ralf