1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

made IM to work with --defaults-file smoothly

This commit is contained in:
petr@mysql.com
2005-02-18 14:58:30 +03:00
parent 7dbe6f3b36
commit dbc0937dd0
13 changed files with 70 additions and 61 deletions

View File

@ -123,7 +123,8 @@ pid_t Instance_options::get_pid()
}
int Instance_options::complete_initialization(const char *default_path)
int Instance_options::complete_initialization(const char *default_path,
int only_instance)
{
const char *tmp;
@ -140,11 +141,23 @@ int Instance_options::complete_initialization(const char *default_path)
{
char pidfilename[MAX_PATH_LEN];
char hostname[MAX_PATH_LEN];
/*
If we created only one istance [mysqld], because no config. files were
found, we would like to model mysqld pid file values.
*/
if (!gethostname(hostname, sizeof(hostname) - 1))
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", hostname, "-",
instance_name, ".pid", NullS);
(only_instance == 0) ?
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", instance_name, "-",
hostname, ".pid", NullS):
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", hostname,
".pid", NullS);
else
(only_instance == 0) ?
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", instance_name,
".pid", NullS):
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", "mysql",
".pid", NullS);
add_option(pidfilename);