[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: 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: Gecko/20080914 Thunderbird/ Mnenhy/

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[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
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at
Comment: Using GnuPG with Mozilla -


reply via email to

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