summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2005-10-21 06:13:04 +0000
committerNeil Brown <neilb@suse.de>2005-10-21 06:13:04 +0000
commit7f48e210799be9765d5bafc4f51bfedc6139a1df (patch)
treea8d0e1b640e3235748a603adb087b2f3bf314a27
parentdcec9ee54779586f287f5db98ab1be3f0f02dd3f (diff)
downloadmdadm-7f48e210799be9765d5bafc4f51bfedc6139a1df.tar.gz
mdadm-7f48e210799be9765d5bafc4f51bfedc6139a1df.tar.xz
mdadm-7f48e210799be9765d5bafc4f51bfedc6139a1df.zip
Make sure mdadm -S returns correct error code
If a bad file names was given, exit status still 0. If some devices couldn't be stopped for "mdadm -Ss" exit status still 0. Thanks: Daniel Hottinger <hotti@google.com> Signed-off-by: Neil Brown <neilb@suse.de>
-rw-r--r--mdadm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mdadm.c b/mdadm.c
index bd29882..ad3d151 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1059,6 +1059,7 @@ int main(int argc, char *argv[])
put_md_name(name);
}
} while (!last && err);
+ if (err) rv |= 1
} else {
fprintf(stderr, Name ": No devices given.\n");
exit(2);
@@ -1088,7 +1089,8 @@ int main(int argc, char *argv[])
rv |= Manage_ro(dv->devname, mdfd, -1); break;
}
close(mdfd);
- }
+ } else
+ rv |= 1;
}
}
break;