summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-09-29 16:30:57 +0200
committerSergei Golubchik <serg@mariadb.org>2019-10-14 10:29:30 +0200
commitf217612fade6684c6003aea9a9bfc7ab41685ace (patch)
tree65ebc4daa0720dd13034840f716437671160f54d /mysys
parent927521a2c18954f03869e91281b90af79b719166 (diff)
downloadmariadb-git-f217612fade6684c6003aea9a9bfc7ab41685ace.tar.gz
MDEV-12684 Show what config file a sysvar got a value from
change get_one_option() prototype to pass the filename and not to pass the redundant optid.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_getopt.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index ab85e231c0f..57c8efd797d 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -442,8 +442,9 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
my_progname, optp->name, optend);
continue;
}
- if (get_one_option(optp->id, optp, *((my_bool*) value) ?
- enabled_my_option : disabled_my_option))
+ if (get_one_option(optp, *((my_bool*) value) ?
+ enabled_my_option : disabled_my_option,
+ filename))
DBUG_RETURN(EXIT_ARGUMENT_INVALID);
continue;
}
@@ -518,7 +519,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
optp->arg_type == NO_ARG)
{
*((my_bool*) optp->value)= (my_bool) 1;
- if (get_one_option(optp->id, optp, argument))
+ if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
continue;
}
@@ -538,7 +539,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
{
if (optp->var_type == GET_BOOL)
*((my_bool*) optp->value)= (my_bool) 1;
- if (get_one_option(optp->id, optp, argument))
+ if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
continue;
}
@@ -559,7 +560,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
if ((error= setval(optp, optp->value, argument,
set_maximum_value)))
DBUG_RETURN(error);
- if (get_one_option(optp->id, optp, argument))
+ if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
break;
}
@@ -606,7 +607,7 @@ int handle_options(int *argc, char ***argv, const struct my_option *longopts,
((error= setval(optp, value, argument, set_maximum_value))) &&
!option_is_loose)
DBUG_RETURN(error);
- if (get_one_option(optp->id, optp, argument))
+ if (get_one_option(optp, argument, filename))
DBUG_RETURN(EXIT_UNSPECIFIED_ERROR);
(*argc)--; /* option handled (long), decrease argument count */