Commit 8390dd10 authored by unknown's avatar unknown

Fixed a bug in mysqladmin shutdown when checking pid file status.

parent e5d75204
...@@ -457,19 +457,18 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) ...@@ -457,19 +457,18 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
my_bool got_pidfile= 0; my_bool got_pidfile= 0;
time_t last_modified= 0; /* to keep compiler happy */ time_t last_modified= 0; /* to keep compiler happy */
struct stat pidfile_status; struct stat pidfile_status;
my_bool check_pidfile_status= 1; my_bool check_pidfile_status= 0;
/* /*
Only wait for pidfile on local connections Only wait for pidfile on local connections
If pidfile doesn't exist, continue without pid file checking If pidfile doesn't exist, continue without pid file checking
*/ */
if (mysql->unix_socket) if (mysql->unix_socket && (got_pidfile= !get_pidfile(mysql, pidfile)) &&
got_pidfile= !get_pidfile(mysql, pidfile); !stat(pidfile, &pidfile_status))
{
if (got_pidfile && stat(pidfile, &pidfile_status)) check_pidfile_status= 1;
check_pidfile_status= 0;
else
last_modified= pidfile_status.st_mtime; last_modified= pidfile_status.st_mtime;
}
if (mysql_shutdown(mysql)) if (mysql_shutdown(mysql))
{ {
......
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