diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-09-29 16:30:57 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-10-14 10:29:30 +0200 |
commit | f217612fade6684c6003aea9a9bfc7ab41685ace (patch) | |
tree | 65ebc4daa0720dd13034840f716437671160f54d /extra | |
parent | 927521a2c18954f03869e91281b90af79b719166 (diff) | |
download | mariadb-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 'extra')
-rw-r--r-- | extra/comp_err.c | 9 | ||||
-rw-r--r-- | extra/innochecksum.cc | 8 | ||||
-rw-r--r-- | extra/mariabackup/innobackupex.cc | 7 | ||||
-rw-r--r-- | extra/mariabackup/xbstream.cc | 9 | ||||
-rw-r--r-- | extra/mariabackup/xtrabackup.cc | 7 | ||||
-rw-r--r-- | extra/my_print_defaults.c | 7 | ||||
-rw-r--r-- | extra/mysql_waitpid.c | 7 | ||||
-rw-r--r-- | extra/perror.c | 7 | ||||
-rw-r--r-- | extra/resolve_stack_dump.c | 7 | ||||
-rw-r--r-- | extra/resolveip.c | 7 |
10 files changed, 38 insertions, 37 deletions
diff --git a/extra/comp_err.c b/extra/comp_err.c index 704bbc0eaf6..a504832a60f 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -150,8 +150,6 @@ static uint parse_input_file(const char *file_name, struct errors **top_error, static int get_options(int *argc, char ***argv); static void print_version(void); static void usage(void); -static my_bool get_one_option(int optid, const struct my_option *opt, - char *argument); static char *parse_text_line(char *pos); static int copy_rows(FILE * to, char *row, int row_nr, long start_pos); static char *parse_default_language(char *str); @@ -1134,11 +1132,12 @@ static void print_version(void) static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__ ((unused)), - char *argument __attribute__ ((unused))) +get_one_option(const struct my_option *opt, + char *argument __attribute__ ((unused)), + const char *filename __attribute__ ((unused))) { DBUG_ENTER("get_one_option"); - switch (optid) { + switch (opt->id) { case 'V': print_version(); my_end(0); diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index aa591de944e..f971fac20ec 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -1332,11 +1332,11 @@ static void usage(void) extern "C" my_bool innochecksum_get_one_option( - int optid, - const struct my_option *opt MY_ATTRIBUTE((unused)), - char *argument MY_ATTRIBUTE((unused))) + const struct my_option *opt, + char *argument MY_ATTRIBUTE((unused)), + const char *) { - switch (optid) { + switch (opt->id) { #ifndef DBUG_OFF case '#': dbug_setting = argument diff --git a/extra/mariabackup/innobackupex.cc b/extra/mariabackup/innobackupex.cc index 952d1f4ec63..fc5e1eef70b 100644 --- a/extra/mariabackup/innobackupex.cc +++ b/extra/mariabackup/innobackupex.cc @@ -728,11 +728,10 @@ indicates an error.\n"); static my_bool -ibx_get_one_option(int optid, - const struct my_option *opt __attribute__((unused)), - char *argument) +ibx_get_one_option(const struct my_option *opt, + char *argument, const char *) { - switch(optid) { + switch(opt->id) { case '?': usage(); exit(0); diff --git a/extra/mariabackup/xbstream.cc b/extra/mariabackup/xbstream.cc index 1655b69235c..d22437427fa 100644 --- a/extra/mariabackup/xbstream.cc +++ b/extra/mariabackup/xbstream.cc @@ -90,8 +90,8 @@ typedef struct { static int get_options(int *argc, char ***argv); static int mode_create(int argc, char **argv); static int mode_extract(int n_threads, int argc, char **argv); -static my_bool get_one_option(int optid, const struct my_option *opt, - char *argument); +static my_bool get_one_option(const struct my_option *opt, + char *argument, const char *filename); int main(int argc, char **argv) @@ -194,10 +194,9 @@ set_run_mode(run_mode_t mode) static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument __attribute__((unused))) +get_one_option(const struct my_option *opt, char *, const char *) { - switch (optid) { + switch (opt->id) { case 'c': if (set_run_mode(RUN_MODE_CREATE)) { return TRUE; diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index d4badc15520..7924791f0e9 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -1628,11 +1628,10 @@ check_if_param_set(const char *param) } my_bool -xb_get_one_option(int optid, - const struct my_option *opt __attribute__((unused)), - char *argument) +xb_get_one_option(const struct my_option *opt, + char *argument, const char *) { - switch(optid) { + switch(opt->id) { case 'h': strmake(mysql_real_data_home,argument, FN_REFLEN - 1); mysql_data_home= mysql_real_data_home; diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index 20daa530dbb..85827b74466 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -104,10 +104,11 @@ static void usage() static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument __attribute__((unused))) +get_one_option(const struct my_option *opt __attribute__((unused)), + char *argument __attribute__((unused)), + const char *filename) { - switch (optid) { + switch (opt->id) { case 'c': opt_defaults_file_used= 1; break; diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c index e19f92261db..92716489bea 100644 --- a/extra/mysql_waitpid.c +++ b/extra/mysql_waitpid.c @@ -44,10 +44,11 @@ static struct my_option my_long_options[] = }; static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument __attribute__((unused))) +get_one_option(const struct my_option *opt, + char *argument __attribute__((unused)), + const char *filename __attribute__((unused))) { - switch(optid) { + switch(opt->id) { case 'V': printf("%s version %s by Jani Tolonen\n", progname, VER); exit(0); diff --git a/extra/perror.c b/extra/perror.c index e3db7b951b7..15c12f10353 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -96,10 +96,11 @@ static void usage(void) static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument __attribute__((unused))) +get_one_option(const struct my_option *opt, + char *argument __attribute__((unused)), + const char *filename __attribute__((unused))) { - switch (optid) { + switch (opt->id) { case 's': verbose=0; break; diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c index e46d0addcc1..1aae413d2a9 100644 --- a/extra/resolve_stack_dump.c +++ b/extra/resolve_stack_dump.c @@ -102,10 +102,11 @@ static void die(const char* fmt, ...) static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument __attribute__((unused))) +get_one_option(const struct my_option *opt, + char *argument __attribute__((unused)), + const char *filename __attribute__((unused))) { - switch(optid) { + switch(opt->id) { case 'V': print_version(); exit(0); diff --git a/extra/resolveip.c b/extra/resolveip.c index 59a32f5f084..6812bc47e8e 100644 --- a/extra/resolveip.c +++ b/extra/resolveip.c @@ -71,10 +71,11 @@ static void usage(void) static my_bool -get_one_option(int optid, const struct my_option *opt __attribute__((unused)), - char *argument __attribute__((unused))) +get_one_option(const struct my_option *opt, + char *argument __attribute__((unused)), + const char *filename __attribute__((unused))) { - switch (optid) { + switch (opt->id) { case 'V': print_version(); exit(0); case 'I': case '?': |