[BusyBox] [patch] new applet mountpoint

Bernhard Fischer rep.nop at aon.at
Fri Aug 19 16:00:26 UTC 2005

On Fri, Aug 19, 2005 at 04:30:02PM +0200, Rainer Weikusat wrote:
>Bernhard Fischer <rep.nop at aon.at> writes:
>> On Fri, Aug 19, 2005 at 11:40:57AM +0200, Rainer Weikusat wrote:
>>>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
>>>        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

Hm. the sequence is stat /dir && stat /dir/.. || exit failure;
Please explain that race?

>inefficient (pointless memory allocations) and does some stuff which

If you refer to the call to bb_xasprintf, perusing this was smaller than
doing it by hand. Care to explain how you would accomplish this more
What other inefficiencies (apart from the strerror) do you mean? Just

>is hardly useful (like printing a single \n with printf
>(putchar, anyone?) when told to be quiet) and does some things which

You're right on the putchar. I agree that it looks a bit odd, but
sysvinit does print that newline so i added it to be compatible.

>are just weird (why the 'stat/lstat'-combination)?

My copy of the mountpoint manpage reads:
Symbolic  links are not followed, except when the -x option is used.

More information about the busybox mailing list