Commit 0c745c74 authored by Michael Widenius's avatar Michael Widenius

Don't give warnings from perror or resolveip with safemalloc

- Added my_end(0) before exit
- Fixed typo in mysql_install_db
parent 255328d3
...@@ -105,11 +105,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -105,11 +105,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break; break;
case 'V': case 'V':
print_version(); print_version();
my_end(0);
exit(0); exit(0);
break; break;
case 'I': case 'I':
case '?': case '?':
usage(); usage();
my_end(0);
exit(0); exit(0);
break; break;
} }
...@@ -122,7 +124,10 @@ static int get_options(int *argc,char ***argv) ...@@ -122,7 +124,10 @@ static int get_options(int *argc,char ***argv)
int ho_error; int ho_error;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
{
my_end(0);
exit(ho_error); exit(ho_error);
}
if (!*argc && !print_all_codes) if (!*argc && !print_all_codes)
{ {
...@@ -260,7 +265,10 @@ int main(int argc,char *argv[]) ...@@ -260,7 +265,10 @@ int main(int argc,char *argv[])
MY_INIT(argv[0]); MY_INIT(argv[0]);
if (get_options(&argc,&argv)) if (get_options(&argc,&argv))
{
my_end(0);
exit(1); exit(1);
}
my_handler_error_register(); my_handler_error_register();
......
...@@ -79,6 +79,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -79,6 +79,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case 'I': case 'I':
case '?': case '?':
usage(); usage();
my_end(0);
exit(0); exit(0);
} }
return 0; return 0;
...@@ -91,7 +92,10 @@ static int get_options(int *argc,char ***argv) ...@@ -91,7 +92,10 @@ static int get_options(int *argc,char ***argv)
int ho_error; int ho_error;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
{
my_end(0);
exit(ho_error); exit(ho_error);
}
if (*argc == 0) if (*argc == 0)
{ {
...@@ -113,10 +117,14 @@ int main(int argc, char **argv) ...@@ -113,10 +117,14 @@ int main(int argc, char **argv)
MY_INIT(argv[0]); MY_INIT(argv[0]);
if (get_options(&argc,&argv)) if (get_options(&argc,&argv))
{
my_end(0);
exit(1); exit(1);
}
while (argc--) while (argc--)
{ {
my_bool do_more;
#ifndef WIN32 #ifndef WIN32
struct in_addr addr; struct in_addr addr;
#endif #endif
...@@ -125,13 +133,13 @@ int main(int argc, char **argv) ...@@ -125,13 +133,13 @@ int main(int argc, char **argv)
/* Not compatible with IPv6! Probably should use getnameinfo(). */ /* Not compatible with IPv6! Probably should use getnameinfo(). */
#ifdef WIN32 #ifdef WIN32
taddr = inet_addr(ip); taddr = inet_addr(ip);
if(taddr != INADDR_NONE) do_more= (taddr != INADDR_NONE);
{
#else #else
if (inet_aton(ip, &addr) != 0) if ((do_more= (inet_aton(ip, &addr) != 0)))
{
taddr= addr.s_addr; taddr= addr.s_addr;
#endif #endif
if (do_more)
{
if (taddr == htonl(INADDR_BROADCAST)) if (taddr == htonl(INADDR_BROADCAST))
{ {
puts("Broadcast"); puts("Broadcast");
...@@ -205,5 +213,6 @@ int main(int argc, char **argv) ...@@ -205,5 +213,6 @@ int main(int argc, char **argv)
} }
} }
} }
my_end(0);
exit(error); exit(error);
} }
...@@ -239,7 +239,7 @@ cannot_find_file() ...@@ -239,7 +239,7 @@ cannot_find_file()
echo echo
echo "If you compiled from source, you need to either run 'make install' to" 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 "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 "option to only install the mysql database and privilege tables"
echo echo
echo "If you are using a binary release, you must either be at the top" echo "If you are using a binary release, you must either be at the top"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment