summaryrefslogtreecommitdiff
path: root/client/mysqladmin.cc
diff options
context:
space:
mode:
authorDan Ungureanu <udan1107@gmail.com>2016-03-08 13:27:18 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2016-06-12 22:47:18 +0300
commit3c77a00d55efe901db9cb52ec000cc93d909a3c9 (patch)
treec8b50ffa3193ff035c07a237ced45503f5f7e590 /client/mysqladmin.cc
parent416006a3d8164684a1bfffa2e20a1f9894baf372 (diff)
downloadmariadb-git-3c77a00d55efe901db9cb52ec000cc93d909a3c9.tar.gz
MDEV-8012: Wrong exit code when asking for help
`--help` is a perfectly valid parameter and both `mysqladmin` and `mysql_waitpid` should exit with success (zero errror code). Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
Diffstat (limited to 'client/mysqladmin.cc')
-rw-r--r--client/mysqladmin.cc11
1 files changed, 2 insertions, 9 deletions
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 9fd8a9b36fc..e7c6410978d 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -232,8 +232,6 @@ my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
- int error = 0;
-
switch(optid) {
case 'c':
opt_count_iterations= 1;
@@ -281,8 +279,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case '?':
case 'I': /* Info */
- error++;
- break;
+ usage();
+ exit(0);
case OPT_CHARSETS_DIR:
#if MYSQL_VERSION_ID > 32300
charsets_dir = argument;
@@ -293,11 +291,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt->name);
break;
}
- if (error)
- {
- usage();
- exit(1);
- }
return 0;
}