From 59ed16fa7591513691a812ada1c9b1ebb2b426f7 Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Fri, 14 Apr 2017 15:19:41 -0400 Subject: [PATCH] LU-6210 utils: Use C99 struct initializers in lfs_mv() 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_mv() to use the C99 syntax. Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: I81b9ace65b7f26766173199f6a14d947ccc86158 Reviewed-on: https://review.whamcloud.com/27516 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- lustre/utils/lfs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 435cf5d..7531605 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -3065,10 +3065,9 @@ static int lfs_mv(int argc, char **argv) int c; int rc = 0; struct option long_opts[] = { - {"mdt-index", required_argument, 0, 'M'}, - {"verbose", no_argument, 0, 'v'}, - {0, 0, 0, 0} - }; + { .val = 'M', .name = "mdt-index", .has_arg = required_argument }, + { .val = 'v', .name = "verbose", .has_arg = no_argument }, + { .name = NULL } }; while ((c = getopt_long(argc, argv, "M:v", long_opts, NULL)) != -1) { switch (c) { -- 1.8.3.1