summaryrefslogtreecommitdiff
path: root/Manage.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-11-22 19:35:25 +1100
committerNeilBrown <neilb@suse.de>2010-11-22 19:35:25 +1100
commitfeab51f8f710f28a63a5b01ec59a5a609a45525b (patch)
treea12fafbfb76d636720f869a394051eb972609988 /Manage.c
parent8d86ffefdf9c91d1d01e27c671735b7bd5301e66 (diff)
open_subarray: pass subarray name as explicit arg.
Rather than hiding this arg in the 'st' structure, pass it explicitly. This is a first step to getting rid of 'subarray' from 'supertype'. The strcpy in open_subarray should have better error checking, but it will disappear soon so there is little point. Signed-off-by: NeilBrown <neilb@suse.de.
Diffstat (limited to 'Manage.c')
-rw-r--r--Manage.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/Manage.c b/Manage.c
index d9530a48..c3322f4d 100644
--- a/Manage.c
+++ b/Manage.c
@@ -1037,16 +1037,8 @@ int Update_subarray(char *dev, char *subarray, char *update, mddev_ident_t ident
int fd, rv = 2;
memset(st, 0, sizeof(*st));
- if (snprintf(st->subarray, sizeof(st->subarray), "%s", subarray) >=
- (signed)sizeof(st->subarray)) {
- if (!quiet)
- fprintf(stderr,
- Name ": Input overflow for subarray '%s' > %zu bytes\n",
- subarray, sizeof(st->subarray) - 1);
- return 2;
- }
- fd = open_subarray(dev, st, quiet);
+ fd = open_subarray(dev, subarray, st, quiet);
if (fd < 0)
return 2;