From 8f66e833b9042c8015bf7a5ce0dbe2fd8fb91af1 Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Fri, 14 Apr 2017 15:41:51 -0400 Subject: [PATCH] LU-6210 utils: Use C99 struct initializers in lfs_fid2path() This patch makes no functional changes. Struct initializers that use C89 or GCC-only syntax are updated to C99 syntax. Variables of type struct option are renamed to long_opts for consistency. 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_fid2path() to use the C99 syntax. Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: I65fb184a54aad142a87dd8f244e99a09a6482b71 Reviewed-on: https://review.whamcloud.com/27524 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond --- 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 cd70601..6aeb484 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -4597,10 +4597,9 @@ static int lfs_fid2path(int argc, char **argv) static int lfs_path2fid(int argc, char **argv) { - struct option long_opts[] = { - {"parents", no_argument, 0, 'p'}, - {0, 0, 0, 0} - }; + struct option long_opts[] = { + { .val = 'p', .name = "parents", .has_arg = no_argument }, + { .name = NULL } }; char **path; const char short_opts[] = "p"; const char *sep = ""; -- 1.8.3.1