From f905bc45f49a183d8953001bd5da2741ab8c6d62 Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Fri, 14 Apr 2017 15:25:15 -0400 Subject: [PATCH] LU-6210 utils: Use C99 struct initializers in lfs_df() This patch makes no functional changes. Struct initializers that use C89 or GCC-only syntax are updated to C99 syntax. C89 positional initializers require values to be placed in the correct order. This will cause errors if the fields of the struct definition are reordered or fields are added or removed. C99 named initializers avoid this problem, and also automatically clear any values that are not explicitly set. This patch updates lfs_df() to use the C99 syntax. Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: I006857f76e2a0bd89fea41fef158931953b21aa8 Reviewed-on: https://review.whamcloud.com/27518 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: John L. Hammond --- lustre/utils/lfs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 7e2c61e..668f261 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -3370,13 +3370,13 @@ static int lfs_df(int argc, char **argv) int c, rc = 0, index = 0; char fsname[PATH_MAX] = "", *pool_name = NULL; struct option long_opts[] = { - {"human-readable", 0, 0, 'h'}, - {"inodes", 0, 0, 'i'}, - {"lazy", 0, 0, 'l'}, - {"pool", required_argument, 0, 'p'}, - {"verbose", 0, 0, 'v'}, - {0, 0, 0, 0} - }; + { .val = 'h', .name = "human-readable", + .has_arg = no_argument }, + { .val = 'i', .name = "inodes", .has_arg = no_argument }, + { .val = 'l', .name = "lazy", .has_arg = no_argument }, + { .val = 'p', .name = "pool", .has_arg = required_argument }, + { .val = 'v', .name = "verbose", .has_arg = no_argument }, + { .name = NULL} }; while ((c = getopt_long(argc, argv, "hilp:v", long_opts, NULL)) != -1) { switch (c) { -- 1.8.3.1