mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
several fixes to the previous patch
server-tools/instance-manager/instance_options.cc: fix order of if branches server-tools/instance-manager/instance_options.h: portability fix server-tools/instance-manager/parse_output.cc: remove stupid comment server-tools/instance-manager/parse_output.h: portability fix
This commit is contained in:
@ -370,19 +370,19 @@ int Instance_options::complete_initialization(const char *default_path,
|
|||||||
if (!gethostname(hostname, sizeof(hostname) - 1))
|
if (!gethostname(hostname, sizeof(hostname) - 1))
|
||||||
{
|
{
|
||||||
if (instance_type & DEFAULT_SINGLE_INSTANCE)
|
if (instance_type & DEFAULT_SINGLE_INSTANCE)
|
||||||
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", instance_name, "-",
|
|
||||||
hostname, ".pid", NullS);
|
|
||||||
else
|
|
||||||
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", hostname,
|
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", hostname,
|
||||||
".pid", NullS);
|
".pid", NullS);
|
||||||
|
else
|
||||||
|
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", instance_name,
|
||||||
|
"-", hostname, ".pid", NullS);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (instance_type & DEFAULT_SINGLE_INSTANCE)
|
if (instance_type & DEFAULT_SINGLE_INSTANCE)
|
||||||
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", instance_name,
|
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", "mysql",
|
||||||
".pid", NullS);
|
".pid", NullS);
|
||||||
else
|
else
|
||||||
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", "mysql",
|
strxnmov(pidfilename, MAX_PATH_LEN - 1, "--pid-file=", instance_name,
|
||||||
".pid", NullS);
|
".pid", NullS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,8 @@
|
|||||||
don't have to synchronize between threads.
|
don't have to synchronize between threads.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
enum { USUAL_INSTANCE= 0, DEFAULT_SINGLE_INSTANCE };
|
#define USUAL_INSTANCE 0
|
||||||
|
#define DEFAULT_SINGLE_INSTANCE 1
|
||||||
|
|
||||||
class Instance_options
|
class Instance_options
|
||||||
{
|
{
|
||||||
|
@ -86,7 +86,7 @@ int parse_output_and_get_value(const char *command, const char *word,
|
|||||||
an option value) or the whole line (if flag)
|
an option value) or the whole line (if flag)
|
||||||
*/
|
*/
|
||||||
linep+= found_word_len; /* swallow the previous one */
|
linep+= found_word_len; /* swallow the previous one */
|
||||||
if (flag & GET_VALUE) /* not GET_LINE */
|
if (flag & GET_VALUE)
|
||||||
{
|
{
|
||||||
get_word((const char **) &linep, &found_word_len, NONSPACE);
|
get_word((const char **) &linep, &found_word_len, NONSPACE);
|
||||||
if (input_buffer_len <= found_word_len)
|
if (input_buffer_len <= found_word_len)
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
enum { GET_VALUE= 1, GET_LINE };
|
#define GET_VALUE 1
|
||||||
|
#define GET_LINE 2
|
||||||
|
|
||||||
int parse_output_and_get_value(const char *command, const char *word,
|
int parse_output_and_get_value(const char *command, const char *word,
|
||||||
char *result, size_t input_buffer_len,
|
char *result, size_t input_buffer_len,
|
||||||
|
Reference in New Issue
Block a user