diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2018-03-15 15:34:45 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2018-03-16 13:26:52 +0400 |
commit | 0a534348c75cf435d2017959855de2efa798fd0b (patch) | |
tree | 48c7ee2f194ccf375877e4be7014c56e6adf8601 /client | |
parent | 7033af9e81a69d75199faa028f8959667f755551 (diff) | |
download | mariadb-git-0a534348c75cf435d2017959855de2efa798fd0b.tar.gz |
MDEV-14265 - RPMLint warning: shared-lib-calls-exit
Eliminated last exit() call from libmysqld.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 6 | ||||
-rw-r--r-- | client/mysql_upgrade.c | 6 | ||||
-rw-r--r-- | client/mysqladmin.cc | 7 | ||||
-rw-r--r-- | client/mysqlbinlog.cc | 4 | ||||
-rw-r--r-- | client/mysqlcheck.c | 5 | ||||
-rw-r--r-- | client/mysqldump.c | 3 | ||||
-rw-r--r-- | client/mysqlimport.c | 3 | ||||
-rw-r--r-- | client/mysqlshow.c | 3 | ||||
-rw-r--r-- | client/mysqlslap.c | 6 | ||||
-rw-r--r-- | client/mysqltest.cc | 4 |
10 files changed, 12 insertions, 35 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 7973c3c7fc3..0b8be00c542 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1175,11 +1175,7 @@ int main(int argc,char *argv[]) close(stdout_fileno_copy); /* Clean up dup(). */ } - if (load_defaults("my",load_default_groups,&argc,&argv)) - { - my_end(0); - exit(1); - } + load_defaults_or_exit("my", load_default_groups, &argc, &argv); defaults_argv=argv; if ((status.exit_status= get_options(argc, (char **) argv))) mysql_end(-1); diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index cbdd398c1e1..5eb495774ce 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -1133,6 +1133,8 @@ int main(int argc, char **argv) char self_name[FN_REFLEN + 1]; MY_INIT(argv[0]); + load_defaults_or_exit("my", load_default_groups, &argc, &argv); + defaults_argv= argv; /* Must be freed by 'free_defaults' */ #if __WIN__ if (GetModuleFileName(NULL, self_name, FN_REFLEN) == 0) @@ -1145,10 +1147,6 @@ int main(int argc, char **argv) init_dynamic_string(&conn_args, "", 512, 256)) die("Out of memory"); - if (load_defaults("my", load_default_groups, &argc, &argv)) - die(NULL); - defaults_argv= argv; /* Must be freed by 'free_defaults' */ - if (handle_options(&argc, &argv, my_long_options, get_one_option)) die(NULL); if (debug_info_flag) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 897c2eb41c3..d4d40b0a0f2 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -319,8 +319,7 @@ int main(int argc,char *argv[]) MY_INIT(argv[0]); mysql_init(&mysql); sf_leaking_memory=1; /* don't report memory leaks on early exits */ - if ((error= load_defaults("my",load_default_groups,&argc,&argv))) - goto err1; + load_defaults_or_exit("my", load_default_groups, &argc, &argv); save_argv = argv; /* Save for free_defaults */ if ((error=handle_options(&argc, &argv, my_long_options, get_one_option))) @@ -500,10 +499,8 @@ err2: my_free(shared_memory_base_name); #endif free_defaults(save_argv); -err1: my_end(my_end_arg); - exit(error); - return 0; + return error; } diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index b871a70ef01..9753125dd67 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2666,9 +2666,7 @@ int main(int argc, char** argv) tzset(); // set tzname init_alloc_root(&s_mem_root, 16384, 0, MYF(0)); - if (load_defaults("my", load_groups, &argc, &argv)) - exit(1); - + load_defaults_or_exit("my", load_groups, &argc, &argv); defaults_argv= argv; if (!(binlog_filter= new Rpl_filter)) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 47cb38751eb..a4410eba8aa 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -1165,9 +1165,7 @@ int main(int argc, char **argv) /* ** Check out the args */ - if (load_defaults("my", load_default_groups, &argc, &argv)) - goto end2; - + load_defaults_or_exit("my", load_default_groups, &argc, &argv); defaults_argv= argv; if (get_options(&argc, &argv)) goto end1; @@ -1243,7 +1241,6 @@ int main(int argc, char **argv) my_free(shared_memory_base_name); mysql_library_end(); free_defaults(defaults_argv); - end2: my_end(my_end_arg); return ret; } /* main */ diff --git a/client/mysqldump.c b/client/mysqldump.c index 5c0ec2a5510..d2348284e31 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -976,8 +976,7 @@ static int get_options(int *argc, char ***argv) opt_net_buffer_length= *mysql_params->p_net_buffer_length; md_result_file= stdout; - if (load_defaults("my",load_default_groups,argc,argv)) - return 1; + load_defaults_or_exit("my", load_default_groups, argc, argv); defaults_argv= *argv; if (my_hash_init(&ignore_table, charset_info, 16, 0, 0, diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 9c84d4a62a6..a9c24e20b0a 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -641,8 +641,7 @@ int main(int argc, char **argv) MY_INIT(argv[0]); sf_leaking_memory=1; /* don't report memory leaks on early exits */ - if (load_defaults("my",load_default_groups,&argc,&argv)) - return 1; + load_defaults_or_exit("my", load_default_groups, &argc, &argv); /* argv is changed in the program */ argv_to_free= argv; if (get_options(&argc, &argv)) diff --git a/client/mysqlshow.c b/client/mysqlshow.c index f851c15106e..95ee8d697f3 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -71,8 +71,7 @@ int main(int argc, char **argv) static char **defaults_argv; MY_INIT(argv[0]); sf_leaking_memory=1; /* don't report memory leaks on early exits */ - if (load_defaults("my",load_default_groups,&argc,&argv)) - exit(1); + load_defaults_or_exit("my", load_default_groups, &argc, &argv); defaults_argv=argv; get_options(&argc,&argv); diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 6a0b214305c..0b88a969bc5 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -325,11 +325,7 @@ int main(int argc, char **argv) MY_INIT(argv[0]); sf_leaking_memory=1; /* don't report memory leaks on early exits */ - if (load_defaults("my",load_default_groups,&argc,&argv)) - { - my_end(0); - exit(1); - } + load_defaults_or_exit("my", load_default_groups, &argc, &argv); defaults_argv=argv; if (get_options(&argc,&argv)) { diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 2897555da3f..895c837f68b 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -7299,9 +7299,7 @@ get_one_option(int optid, const struct my_option *opt, char *argument) int parse_args(int argc, char **argv) { - if (load_defaults("my",load_default_groups,&argc,&argv)) - exit(1); - + load_defaults_or_exit("my", load_default_groups, &argc, &argv); default_argv= argv; if ((handle_options(&argc, &argv, my_long_options, get_one_option))) |