diff options
author | NeilBrown <neilb@suse.de> | 2023-03-13 04:42:58 +0100 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2023-03-19 17:33:25 +0100 |
commit | d39fd87e31024804dd7f2c16c03af0379b71f5f1 (patch) | |
tree | 0b2b24796a294fc5dc9d7e4cafdf0ef60b08b6d6 | |
parent | Use existence of /etc/initrd-release to detect initrd. (diff) | |
download | mdadm-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.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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) |