summaryrefslogtreecommitdiff
path: root/extra
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 /extra
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 'extra')
-rw-r--r--extra/mysql_waitpid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/extra/mysql_waitpid.c b/extra/mysql_waitpid.c
index aa004e57308..5cdf1dedc27 100644
--- a/extra/mysql_waitpid.c
+++ b/extra/mysql_waitpid.c
@@ -54,6 +54,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'I':
case '?':
usage();
+ exit(0);
}
return 0;
}
@@ -69,7 +70,10 @@ int main(int argc, char *argv[])
exit(-1);
if (!argv[0] || !argv[1] || (pid= atoi(argv[0])) <= 0 ||
(t= atoi(argv[1])) <= 0)
+ {
usage();
+ exit(-1);
+ }
for (; t > 0; t--)
{
if (kill((pid_t) pid, sig))
@@ -100,5 +104,4 @@ void usage(void)
printf("integer arguments.\n\n");
printf("Options:\n");
my_print_help(my_long_options);
- exit(-1);
}