summaryrefslogtreecommitdiffstats
path: root/mdctl.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2001-07-26 07:00:09 +0000
committerNeil Brown <neilb@suse.de>2001-07-26 07:00:09 +0000
commit82b27616de634964db1a71bd5d9813db71e391a1 (patch)
tree310a2ed60dbb0903c73ba261914da269e9ec9072 /mdctl.c
parent682c705194a869b882cd710d5f996142912db390 (diff)
downloadmdadm-82b27616de634964db1a71bd5d9813db71e391a1.tar.gz
mdadm-82b27616de634964db1a71bd5d9813db71e391a1.tar.xz
mdadm-82b27616de634964db1a71bd5d9813db71e391a1.zip
mdctl-v0.4mdctl-v0.4
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);