summaryrefslogtreecommitdiffstats
path: root/mdctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdctl.c')
-rw-r--r--mdctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mdctl.c b/mdctl.c
index 5a16646..70e8129 100644
--- a/mdctl.c
+++ b/mdctl.c
@@ -347,6 +347,7 @@ int main(int argc, char *argv[])
* There must be an mddev unless D or E or (A and scan)
* If there is one, we open it.
*/
+
if (mode !='D' && mode !='E' && ! (mode =='A' && scan)) {
if (!mddev) {
fprintf(stderr, Name ": an md device must be given in this mode\n");
@@ -366,15 +367,16 @@ int main(int argc, char *argv[])
}
}
+
rv =0;
switch(mode) {
case '@':/* Management */
/* readonly, add/remove, readwrite, runstop */
- if (readonly>1)
+ if (readonly>0)
rv = Manage_ro(mddev, mdfd, readonly);
if (!rv && subdevs)
rv = Manage_subdevs(mddev, mdfd, subdevs, subdev, devmodes);
- if (!rv && readonly < 1)
+ if (!rv && readonly < 0)
rv = Manage_ro(mddev, mdfd, readonly);
if (!rv && runstop)
rv = Manage_runstop(mddev, mdfd, runstop);