[BusyBox] [patch] new applet mountpoint

Rainer Weikusat rainer.weikusat at sncag.com
Fri Aug 19 08:30:02 MDT 2005


Bernhard Fischer <rep.nop at aon.at> writes:
> On Fri, Aug 19, 2005 at 11:40:57AM +0200, Rainer Weikusat wrote:
>>Bernhard Fischer <rep.nop at aon.at> writes:
>>> Attached patch adds a mountpoint(1) applet.
>>>
>>> $ size miscutils/mountpoint.o
>>>    text	   data	    bss	    dec	    hex	filename
>>>     614	      0	      0	    614	    266	miscutils/mountpoint.o
>>>
>>> It's relatively big but feature complete.
>>> Ok?
>>
>>Given that busybox may eventually include an operating system kernel
>>and a C library of its own :->, but will certainly never
>>(substantially) work with a different kernel than Linux, why not
>>
>>mountpoint()
>>{
>>        cut -d' ' -f2 /proc/mounts | grep -q "$1"
>>}
>>
>>plus a set of similar small shell functions that print the other
>>information, insofar requested?
>
> Well, so let's zap head and tail too?

Well, there may be reasons why someone would want to not have tail,
but that's not the same question as "Why mountpoint.c", especially
considering that your implementation is both broken due to various
races (the stat/ lstat calls, for instance), needlessly
inefficient (pointless memory allocations) and does some stuff which
is hardly useful (like printing a single \n with printf
(putchar, anyone?) when told to be quiet) and does some things which
are just weird (why the 'stat/lstat'-combination)?


More information about the busybox mailing list