On Sat, 27 Feb 2010 16:07:04 +0100 Luca Berra <bluca@xxxxxxxxxx> wrote: > running mdmon --takeover --all resulted in a segfault. > also hide "--takeover" from ps and update usage message. Why do you want to hide the "--takeover" ??? (the rest makes sense, thanks). NeilBrown > > Signed-off-by: Luca Berra <bluca@xxxxxxxxxx> > --- > mdmon.c | 13 +++++++++---- > 1 files changed, 9 insertions(+), 4 deletions(-) > > diff --git a/mdmon.c b/mdmon.c > index 70fbd0b..d593ebc 100644 > --- a/mdmon.c > +++ b/mdmon.c > @@ -244,7 +244,7 @@ static int do_fork(void) > > void usage(void) > { > - fprintf(stderr, "Usage: mdmon /device/name/for/container [target_dir]\n"); > + fprintf(stderr, "Usage: mdmon [--all] [--takeover] CONTAINER"); > exit(2); > } > > @@ -262,15 +262,20 @@ int main(int argc, char *argv[]) > > for (arg = 1; arg < argc; arg++) { > if (strcmp(argv[arg], "--all") == 0 || > - strcmp(argv[arg], "/proc/mdstat") == 0) > + strcmp(argv[arg], "/proc/mdstat") == 0) { > + container_name = argv[arg]; > all = 1; > - else if (strcmp(argv[arg], "--takeover") == 0) > + } else if (strcmp(argv[arg], "--takeover") == 0) { > + /* hide the --takeover arg from commandline */ > + memset(argv[arg], 0, strlen(argv[arg])); > takeover = 1; > - else if (container_name == NULL) > + } else if (container_name == NULL) > container_name = argv[arg]; > else > usage(); > } > + if (container_name == NULL) > + usage(); > > if (all) { > struct mdstat_ent *mdstat, *e; -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html