From: bobijam Date: Tue, 28 Apr 2009 01:22:24 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_170~3 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c73162fd3537726ef187fe2fd5f926813f79578b;p=fs%2Flustre-release.git Branch HEAD b=18683 i=joahnn i=sheng.yang If no options are given, tunefs.lustre/mkfs.lustre just print info. --- diff --git a/lustre/utils/mkfs_lustre.c b/lustre/utils/mkfs_lustre.c index 95dce17..41f5b19 100644 --- a/lustre/utils/mkfs_lustre.c +++ b/lustre/utils/mkfs_lustre.c @@ -1135,7 +1135,7 @@ static char *convert_hostnames(char *s1) sep = *s2; *s2 = '\0'; nid = libcfs_str2nid(s1); - + if (nid == LNET_NID_ANY) { fprintf(stderr, "%s: Can't parse NID '%s'\n", progname, s1); free(converted); @@ -1150,7 +1150,7 @@ static char *convert_hostnames(char *s1) free(converted); return NULL; } - + c += snprintf(c, left, "%s%c", libcfs_nid2str(nid), sep); left = converted + MAXNIDSTR - c; s1 = s2 + 1; @@ -1375,6 +1375,10 @@ int parse_opts(int argc, char *const argv[], struct mkfs_opts *mop, return EINVAL; } + /* single argument: */ + if (argc == 2) + ++print_only; + return 0; }