diff options
author | petr@mysql.com <> | 2005-02-15 04:38:33 +0300 |
---|---|---|
committer | petr@mysql.com <> | 2005-02-15 04:38:33 +0300 |
commit | 59d8e51150faa3aeaf489c4454fd6780ad849239 (patch) | |
tree | 11422217e66ff042bc75eb00563d6c7b1f36e26f /server-tools/instance-manager/instance_options.cc | |
parent | bb8e5b6227ef83b67fd9a786bd32768231d42bdb (diff) | |
download | mariadb-git-59d8e51150faa3aeaf489c4454fd6780ad849239.tar.gz |
some more cleanups and fixes
Diffstat (limited to 'server-tools/instance-manager/instance_options.cc')
-rw-r--r-- | server-tools/instance-manager/instance_options.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/server-tools/instance-manager/instance_options.cc b/server-tools/instance-manager/instance_options.cc index 7c41a556cc4..6b795934d08 100644 --- a/server-tools/instance-manager/instance_options.cc +++ b/server-tools/instance-manager/instance_options.cc @@ -74,13 +74,17 @@ err: } -void Instance_options::get_pid_filename(char *result) +int Instance_options::get_pid_filename(char *result) { const char *pid_file= mysqld_pid_file; char datadir[MAX_PATH_LEN]; if (mysqld_datadir == NULL) - get_default_option(datadir, sizeof(datadir), "--datadir"); + { + /* we might get an error here if we have wrong path to the mysqld binary */ + if (get_default_option(datadir, sizeof(datadir), "--datadir")) + return 1; + } else strxnmov(datadir, MAX_PATH_LEN - 1, strchr(mysqld_datadir, '=') + 1, "/", NullS); @@ -90,6 +94,7 @@ void Instance_options::get_pid_filename(char *result) /* get the full path to the pidfile */ my_load_path(result, pid_file, datadir); + return 0; } @@ -145,7 +150,8 @@ int Instance_options::complete_initialization(const char *default_path) add_option(pidfilename); } - get_pid_filename(pid_file_with_path); + if (get_pid_filename(pid_file_with_path)) + goto err; /* we need to reserve space for the final zero + possible default options */ if (!(argv= (char**) alloc_root(&alloc, (options_array.elements + 1 |