diff options
author | Michael Widenius <monty@mariadb.org> | 2018-07-29 10:56:11 +0300 |
---|---|---|
committer | Michael Widenius <monty@mariadb.org> | 2018-07-29 10:56:11 +0300 |
commit | 0c745c743c65ceb6533babdf21556b633e81566c (patch) | |
tree | 5e23f8cbbab830786b1eaeb6190a639d5b8d7414 /extra/resolveip.c | |
parent | 255328d3931e8526c4248ec2af1f554911376c1b (diff) | |
download | mariadb-git-0c745c743c65ceb6533babdf21556b633e81566c.tar.gz |
Don't give warnings from perror or resolveip with safemalloc
- Added my_end(0) before exit
- Fixed typo in mysql_install_db
Diffstat (limited to 'extra/resolveip.c')
-rw-r--r-- | extra/resolveip.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/extra/resolveip.c b/extra/resolveip.c index b6840d9d463..20941a05257 100644 --- a/extra/resolveip.c +++ b/extra/resolveip.c @@ -79,6 +79,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'I': case '?': usage(); + my_end(0); exit(0); } return 0; @@ -91,7 +92,10 @@ static int get_options(int *argc,char ***argv) int ho_error; if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) + { + my_end(0); exit(ho_error); + } if (*argc == 0) { @@ -113,10 +117,14 @@ int main(int argc, char **argv) MY_INIT(argv[0]); if (get_options(&argc,&argv)) + { + my_end(0); exit(1); + } while (argc--) { + my_bool do_more; #ifndef WIN32 struct in_addr addr; #endif @@ -125,13 +133,13 @@ int main(int argc, char **argv) /* Not compatible with IPv6! Probably should use getnameinfo(). */ #ifdef WIN32 taddr = inet_addr(ip); - if(taddr != INADDR_NONE) - { + do_more= (taddr != INADDR_NONE); #else - if (inet_aton(ip, &addr) != 0) - { + if ((do_more= (inet_aton(ip, &addr) != 0))) taddr= addr.s_addr; #endif + if (do_more) + { if (taddr == htonl(INADDR_BROADCAST)) { puts("Broadcast"); @@ -205,5 +213,6 @@ int main(int argc, char **argv) } } } + my_end(0); exit(error); } |