diff options
author | Sandeep Patil | 2018-07-23 16:50:26 -0500 |
---|---|---|
committer | Sandeep Patil | 2018-07-23 16:50:26 -0500 |
commit | 0d469de9a03f2f587ba2c6323b9706b689e6f599 (patch) | |
tree | 5b4b7580e7ec5d3be0d8ba8b5b9c00432d1d6ae6 | |
parent | 1db3789252342c5bfd34d889792866c3b4357b0c (diff) | |
download | platform-system-core-0d469de9a03f2f587ba2c6323b9706b689e6f599.tar.gz platform-system-core-0d469de9a03f2f587ba2c6323b9706b689e6f599.tar.xz platform-system-core-0d469de9a03f2f587ba2c6323b9706b689e6f599.zip |
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: Sandeep Patil <sspatil@google.com>
-rw-r--r-- | fs_mgr/tools/dmctl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs_mgr/tools/dmctl.cpp b/fs_mgr/tools/dmctl.cpp index 5e11c8423..32cbb32ee 100644 --- a/fs_mgr/tools/dmctl.cpp +++ b/fs_mgr/tools/dmctl.cpp | |||
@@ -132,11 +132,11 @@ static int DmCreateCmdHandler(int argc, char** argv) { | |||
132 | while (arg_index < argc && argv[arg_index][0] == '-') { | 132 | while (arg_index < argc && argv[arg_index][0] == '-') { |
133 | if (strcmp(argv[arg_index], "-ro") == 0) { | 133 | if (strcmp(argv[arg_index], "-ro") == 0) { |
134 | table.set_readonly(true); | 134 | table.set_readonly(true); |
135 | arg_index++; | ||
135 | } else { | 136 | } else { |
136 | std::cerr << "Unrecognized option: " << argv[arg_index] << std::endl; | 137 | std::cerr << "Unrecognized option: " << argv[arg_index] << std::endl; |
137 | return -EINVAL; | 138 | return -EINVAL; |
138 | } | 139 | } |
139 | arg_index++; | ||
140 | } | 140 | } |
141 | 141 | ||
142 | // Parse everything else as target information. | 142 | // Parse everything else as target information. |