Skip to content

Commit

Permalink
Don't give warnings from perror or resolveip with safemalloc
Browse files Browse the repository at this point in the history
- Added my_end(0) before exit
- Fixed typo in mysql_install_db
  • Loading branch information
montywi committed Jul 29, 2018
1 parent 255328d commit 0c745c7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
8 changes: 8 additions & 0 deletions extra/perror.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case 'V':
print_version();
my_end(0);
exit(0);
break;
case 'I':
case '?':
usage();
my_end(0);
exit(0);
break;
}
Expand All @@ -122,7 +124,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 && !print_all_codes)
{
Expand Down Expand Up @@ -260,7 +265,10 @@ int main(int argc,char *argv[])
MY_INIT(argv[0]);

if (get_options(&argc,&argv))
{
my_end(0);
exit(1);
}

my_handler_error_register();

Expand Down
17 changes: 13 additions & 4 deletions extra/resolveip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{
Expand All @@ -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
Expand All @@ -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");
Expand Down Expand Up @@ -205,5 +213,6 @@ int main(int argc, char **argv)
}
}
}
my_end(0);
exit(error);
}
2 changes: 1 addition & 1 deletion scripts/mysql_install_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ cannot_find_file()
echo
echo "If you compiled from source, you need to either run 'make install' to"
echo "copy the software into the correct location ready for operation."
echo "If you don't want to do a full install, you can use the --srcddir"
echo "If you don't want to do a full install, you can use the --srcdir"
echo "option to only install the mysql database and privilege tables"
echo
echo "If you are using a binary release, you must either be at the top"
Expand Down

0 comments on commit 0c745c7

Please sign in to comment.