autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFT] Remove three forks per _AC_RUN_LOG_STDERR


From: Eric Blake
Subject: Re: [RFT] Remove three forks per _AC_RUN_LOG_STDERR
Date: Thu, 06 Nov 2008 06:17:33 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 11/6/2008 6:03 AM:
>> -  ($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.

That adds a fork for rm conftest.er1 in the empty case, which is the more
common of the two.  The semantics are currently such that only
conftest.err exists after the logging, and it is faster to provide the
same effects by using mv only in the error case rather than rm everywhere.
 On the other hand, maybe we could find everywhere that does 'rm
conftest.err' and instead make it 'rm conftest.er[1r]'.

>  Otherwise, ...
> 
>> +    mv conftest.er1 conftest.err
> 
> ... this needs to be 'mv -f'.

Good point.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkS7m0ACgkQ84KuGfSFAYC4aQCgqEv9vYvnoOacCNe6bdzWbgPo
ankAniTrM58ghfkQhtqGsnxhoM8RPUNb
=41nZ
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]