Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d469de9 authored by Sandeep Patil's avatar Sandeep Patil
Browse files

dmctl: Do not skip argument if not matched with '-ro'.



'dmctl create' command would fail if '-ro' flag is not
used. This happend because the argument in place of '-ro'
is skipped unconditionally.

Bug: 72722987
Test:
 $ losetup /dev/block/loop0 fs.img
 $ dmctl create FOO linear 0 25600 /dev/block/loop0 0

Change-Id: I3f6264336b9c9a1b5de76f3a1d29e6045453f9cb
Signed-off-by: default avatarSandeep Patil <sspatil@google.com>
parent 1db37892
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -132,11 +132,11 @@ static int DmCreateCmdHandler(int argc, char** argv) {
    while (arg_index < argc && argv[arg_index][0] == '-') {
        if (strcmp(argv[arg_index], "-ro") == 0) {
            table.set_readonly(true);
            arg_index++;
        } else {
            std::cerr << "Unrecognized option: " << argv[arg_index] << std::endl;
            return -EINVAL;
        }
        arg_index++;
    }

    // Parse everything else as target information.