losetup patch

Denis Vlasenko vda.linux at googlemail.com
Wed Sep 27 14:50:35 UTC 2006


On Wednesday 27 September 2006 13:13, Vladimir Dronnikov wrote:
> Hello, Denis
> 
> Just played with dm-crypt & dmsetup on loopbacked filesystem and noticed that
> BB' losetup lacks mainstream convenient losetup feature -- printing all current associations
> Moreover, BB' losetup behaves quite unfriendly -- e.g., it doesn't like
> # losetup /dev/loop*
> :^)
> Attached is the patch to fix the things
> How about it?

Good patch. Applied.

What follows are just nitpicks, it doesn't mean I didn't like it.


Longer than 80 chars:

        if (opt == 0x3 || opt == 0x4 ) bb_show_usage(); // -d and -o (illegal), -h

(-h option is not needed anyway, --help always works for bbox)


Can fit into stack variable instead:

                char *dev = xstrdup("/dev/loop0");


Inconsistent use of spaces around parentheses:

                for ( c = '0'; c < '8'; ++c ) {
                        dev[9] = c;
                        char *s = query_loop(dev);
                        if ( s ) {
--
vda



More information about the busybox mailing list