summaryrefslogtreecommitdiff
path: root/extra/my_print_defaults.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-10-22 13:03:41 +0200
committerSergei Golubchik <serg@mariadb.org>2017-10-22 13:03:41 +0200
commit9d2e2d753323a934604d25144b9d1ecaf34b47d8 (patch)
tree051a721f7ea77c2278d09323e36088abe22aa66a /extra/my_print_defaults.c
parentd11af09865299033d5eef64531704f6ab8af5304 (diff)
parent2eb3c5e5420a724945a4cba914df25aa1e3744ce (diff)
downloadmariadb-git-9d2e2d753323a934604d25144b9d1ecaf34b47d8.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'extra/my_print_defaults.c')
-rw-r--r--extra/my_print_defaults.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index bfd0c3c635a..cb883a60f85 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -104,12 +104,16 @@ void cleanup_and_exit(int exit_code)
exit(exit_code);
}
-static void usage(my_bool version)
+static void version()
{
- printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE,
- MACHINE_TYPE);
- if (version)
- return;
+ printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
+}
+
+
+static void usage() __attribute__ ((noreturn));
+static void usage()
+{
+ version();
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Prints all arguments that is give to some program using the default files");
printf("Usage: %s [OPTIONS] [groups]\n", my_progname);
@@ -133,12 +137,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
cleanup_and_exit(0);
case 'I':
case '?':
- usage(0);
+ usage();
case 'v':
verbose++;
break;
case 'V':
- usage(1);
+ version();
+ /* fall through */
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
@@ -186,7 +191,7 @@ int main(int argc, char **argv)
nargs+= array_elements(mysqld_groups);
if (nargs < 2)
- usage(0);
+ usage();
load_default_groups=(char**) my_malloc(nargs*sizeof(char*), MYF(MY_WME));
if (!load_default_groups)