From 9afa14529b35de066b395abba448e4d2e9c2999f Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Fri, 19 May 2017 15:51:36 -0400 Subject: [PATCH] LU-6210 utils: Use C99 struct initializer in lustre_rsync.c This patch makes no functional changes. The long_opts struct initializer in lustre_rsync.c is 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. Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: Ic89ee776d5c2578759554446cdc33f5861316130 Reviewed-on: https://review.whamcloud.com/27814 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons --- lustre/utils/lustre_rsync.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lustre/utils/lustre_rsync.c b/lustre/utils/lustre_rsync.c index 2be588c..361d2ad 100644 --- a/lustre/utils/lustre_rsync.c +++ b/lustre/utils/lustre_rsync.c @@ -206,24 +206,24 @@ FILE *debug_log; /* Command line options */ struct option long_opts[] = { - {"source", required_argument, 0, 's'}, - {"target", required_argument, 0, 't'}, - {"mdt", required_argument, 0, 'm'}, - {"user", required_argument, 0, 'u'}, - {"statuslog", required_argument, 0, 'l'}, - {"verbose", no_argument, 0, 'v'}, - {"xattr", required_argument, 0, 'x'}, - {"dry-run", no_argument, 0, 'z'}, - /* Undocumented options follow */ - {"cl-clear", required_argument, 0, 'c'}, - {"use-rsync", no_argument, 0, 'r'}, - {"rsync-threshold", required_argument, 0, 'y'}, - {"start-recno", required_argument, 0, 'n'}, - {"abort-on-err",no_argument, 0, 'a'}, - {"debug", required_argument, 0, 'd'}, - {"debuglog", required_argument, 0, 'D'}, - {0, 0, 0, 0} -}; + { .val = 'l', .name = "statuslog", .has_arg = required_argument }, + { .val = 'm', .name = "mdt", .has_arg = required_argument }, + { .val = 's', .name = "source", .has_arg = required_argument }, + { .val = 't', .name = "target", .has_arg = required_argument }, + { .val = 'u', .name = "user", .has_arg = required_argument }, + { .val = 'v', .name = "verbose", .has_arg = no_argument }, + { .val = 'x', .name = "xattr", .has_arg = required_argument }, + { .val = 'z', .name = "dry-run", .has_arg = no_argument }, + /* Undocumented options follow */ + { .val = 'a', .name = "abort-on-err", .has_arg = no_argument }, + { .val = 'c', .name = "cl-clear", .has_arg = required_argument }, + { .val = 'd', .name = "debug", .has_arg = required_argument }, + { .val = 'D', .name = "debuglog", .has_arg = required_argument }, + { .val = 'n', .name = "start-recno", .has_arg = required_argument }, + { .val = 'r', .name = "use-rsync", .has_arg = no_argument }, + { .val = 'y', .name = "rsync-threshold", + .has_arg = required_argument }, + { .name = NULL } }; /* Command line usage */ void lr_usage() -- 1.8.3.1