[BusyBox] umount size reduction

Rob Landley rob at landley.net
Sat Sep 24 23:58:32 UTC 2005


On Saturday 24 September 2005 01:18, Mike Frysinger wrote:
> On Thursday 25 August 2005 08:24 am, Tito wrote:
> > I've reduced the size of umount by using getoptulflags.
> > So far I've no diff as it needs more testing and i don't know
> > enough about the corner cases and probably I've messed up
> > a bit your logic.
> > Maybe you can give it a look and a try?!
>
> rob, this looks pretty sane to me ... since it is a pretty good size
> reduction, could you look it over ? :)
> -mike

He never sent me a diff, but I suppose I can do diff -u myself...

I vaguely remember that I initially didn't use the bb_ arg parsing stuff in 
mount because it was likely to interact horribly with the parsing hack I did 
for --move and such.  (It's also hard to come up with a good test suite for 
this stuff because you've got to run it as root and probably reboot if 
anything goes wrong.  It's a to-do item, something involving UML probably.)  
But that shouldn't affect umount, so let's look at it:

#defines in a function body are evil.  I'll move that...

It now accepts -D when loop support is disabled, and -n when mtab support is 
disabled.  (It treats them as NOPs.  OK, I guess...)

You reversed the meaning of -D.  Fixed it.  (And updated the usage.)

It still has commented out unfinished stuff.  Removed two instances I noticed.

No compiler worth its salt should warn about if(var & constant), since if(var 
&& constant) would optimize away.  You still need the parentheses to overcome 
broken precedence rules in C, but the double parentheses by themselves are 
workarounds for _broken_ compiler warnings.  (I removed that.)

If you make a one line if() do()  statement longer to the point where the do() 
part goes off the right edge of an 80 column display, move the do() to the 
next line already...

The rest seems sane.  Applied.

Rob



More information about the busybox mailing list