summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2023-03-13 04:42:58 +0100
committerJes Sorensen <jes@trained-monkey.org>2023-03-19 17:33:25 +0100
commitd39fd87e31024804dd7f2c16c03af0379b71f5f1 (patch)
tree0b2b24796a294fc5dc9d7e4cafdf0ef60b08b6d6
parentUse existence of /etc/initrd-release to detect initrd. (diff)
downloadmdadm-d39fd87e31024804dd7f2c16c03af0379b71f5f1.tar.xz
mdadm-d39fd87e31024804dd7f2c16c03af0379b71f5f1.zip
mdmon: don't test both 'all' and 'container_name'.
If 'all' is not set, then container_name must be NULL, as nothing else can set it. So simplify the test to ignore container_name. This makes the purpose of the code more obvious. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
-rw-r--r--mdmon.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/mdmon.c b/mdmon.c
index 60ba3182..f8fd2f0f 100644
--- a/mdmon.c
+++ b/mdmon.c
@@ -352,7 +352,6 @@ int main(int argc, char *argv[])
}
}
-
if (in_initrd()) {
/*
* set first char of argv[0] to @. This is used by
@@ -362,12 +361,10 @@ int main(int argc, char *argv[])
argv[0][0] = '@';
}
- if (all == 0 && container_name == NULL) {
- if (argv[optind]) {
- container_name = get_md_name(argv[optind]);
- if (!container_name)
- return 1;
- }
+ if (!all && argv[optind]) {
+ container_name = get_md_name(argv[optind]);
+ if (!container_name)
+ return 1;
}
if (container_name == NULL || argc - optind > 1)