From ce7bb5449ab15bb9c6e8a1b2dc22be7c8efe74be Mon Sep 17 00:00:00 2001 From: Steve Guminski Date: Fri, 14 Apr 2017 15:27:22 -0400 Subject: [PATCH] LU-6210 utils: Use C99 initializers in lfs_setquota_times() 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_setquota_times() to use the C99 syntax. Test-Parameters: trivial Signed-off-by: Steve Guminski Change-Id: I50c6260246e0ac345d8b981dd624791bab9220a5 Reviewed-on: https://review.whamcloud.com/27519 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond --- lustre/utils/lfs.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 668f261..339d745 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -3606,14 +3606,13 @@ int lfs_setquota_times(int argc, char **argv) struct obd_dqblk *dqb = &qctl.qc_dqblk; struct obd_dqinfo *dqi = &qctl.qc_dqinfo; struct option long_opts[] = { - {"block-grace", required_argument, 0, 'b'}, - {"group", no_argument, 0, 'g'}, - {"inode-grace", required_argument, 0, 'i'}, - {"projid", no_argument, 0, 'p'}, - {"times", no_argument, 0, 't'}, - {"user", no_argument, 0, 'u'}, - {0, 0, 0, 0} - }; + { .val = 'b', .name = "block-grace", .has_arg = required_argument }, + { .val = 'g', .name = "group", .has_arg = no_argument }, + { .val = 'i', .name = "inode-grace", .has_arg = required_argument }, + { .val = 'p', .name = "projid", .has_arg = no_argument }, + { .val = 't', .name = "times", .has_arg = no_argument }, + { .val = 'u', .name = "user", .has_arg = no_argument }, + { .name = NULL } }; int qtype; memset(&qctl, 0, sizeof(qctl)); -- 1.8.3.1