From: Neil Brown Date: Fri, 21 Oct 2005 06:13:04 +0000 (+0000) Subject: Make sure mdadm -S returns correct error code X-Git-Tag: mdadm-2.2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f48e210799be9765d5bafc4f51bfedc6139a1df;p=thirdparty%2Fmdadm.git 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 Signed-off-by: Neil Brown --- diff --git a/mdadm.c b/mdadm.c index bd29882c..ad3d1517 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;