From c73162fd3537726ef187fe2fd5f926813f79578b Mon Sep 17 00:00:00 2001 From: bobijam Date: Tue, 28 Apr 2009 01:22:24 +0000 Subject: [PATCH] Branch HEAD b=18683 i=joahnn i=sheng.yang If no options are given, tunefs.lustre/mkfs.lustre just print info. --- lustre/utils/mkfs_lustre.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; } -- 1.8.3.1