cvs commit: src/etc rc.subr

Doug Barton dougb at FreeBSD.org
Wed Jul 26 05:27:54 UTC 2006


Yar Tikhiy wrote:
> yar         2006-07-25 17:20:22 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     etc                  rc.subr 
>   Log:
>   Avoid extra runs of test(1) by using its built-in logical operations.
>   
>   Revision  Changes    Path
>   1.63      +9 -15     src/etc/rc.subr
> 
> http://www.FreeBSD.org/cgi/cvsweb.cgi/src/etc/rc.subr.diff?&r1=1.62&r2=1.63&f=h

I'm pretty sure that this commit has the opposite effect from what you
intended. If you do:

[ foo -a bar ]

then the bar test will always be run, whereas if you do

[ foo ] && [ bar ]

bar won't run unless foo succeeds.

Also, you should be aware that in our /bin/sh test is a builtin, so what
you're trying to optimize for is not actually an issue to start with.

Unless you can show that this commit actually does improve performance, I'd
appreciate it if you'd reverse it.

Doug

-- 

    This .signature sanitized for your protection



More information about the cvs-src mailing list