Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/util-linux/losetup.c

    r2725 r3232  
    77 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88 */
     9
     10//usage:#define losetup_trivial_usage
     11//usage:       "[-r] [-o OFS] LOOPDEV FILE - associate loop devices\n"
     12//usage:       "    losetup -d LOOPDEV - disassociate\n"
     13//usage:       "    losetup [-f] - show"
     14//usage:#define losetup_full_usage "\n\n"
     15//usage:       "    -o OFS  Start OFS bytes into FILE"
     16//usage:     "\n    -r  Read-only"
     17//usage:     "\n    -f  Show first free loop device"
     18//usage:
     19//usage:#define losetup_notes_usage
     20//usage:       "No arguments will display all current associations.\n"
     21//usage:       "One argument (losetup /dev/loop1) will display the current association\n"
     22//usage:       "(if any), or disassociate it (with -d). The display shows the offset\n"
     23//usage:       "and filename of the file the loop device is currently bound to.\n\n"
     24//usage:       "Two arguments (losetup /dev/loop1 file.img) create a new association,\n"
     25//usage:       "with an optional offset (-o 12345). Encryption is not yet supported.\n"
     26//usage:       "losetup -f will show the first loop free loop device\n\n"
    927
    1028#include "libbb.h"
     
    2139        OPT_o = (1 << 1),
    2240        OPT_f = (1 << 2),
     41        OPT_r = (1 << 3), /* must be last */
    2342    };
    2443
    25     /* max 2 args, all opts are mutually exclusive */
     44    /* max 2 args, -d,-o,-f opts are mutually exclusive */
    2645    opt_complementary = "?2:d--of:o--df:f--do";
    27     opt = getopt32(argv, "do:f", &opt_o);
     46    opt = getopt32(argv, "do:fr", &opt_o);
    2847    argv += optind;
    2948
     
    4766
    4867        if (argv[1]) {
    49             /* [-o OFS] BLOCKDEV FILE */
    50             if (set_loop(&argv[0], argv[1], offset) < 0)
     68            /* [-r] [-o OFS] BLOCKDEV FILE */
     69            if (set_loop(&argv[0], argv[1], offset, (opt / OPT_r)) < 0)
    5170                bb_simple_perror_msg_and_die(argv[0]);
    5271            return EXIT_SUCCESS;
    5372        }
    54         /* [-o OFS] BLOCKDEV */
     73        /* [-r] [-o OFS] BLOCKDEV */
    5574        s = query_loop(argv[0]);
    5675        if (!s)
     
    6281    }
    6382
    64     /* [-o OFS|-f] with no params */
     83    /* [-r] [-o OFS|-f] with no params */
    6584    n = 0;
    6685    while (1) {
Note: See TracChangeset for help on using the changeset viewer.