diff options
author | unknown <petr@mysql.com> | 2005-02-15 04:38:33 +0300 |
---|---|---|
committer | unknown <petr@mysql.com> | 2005-02-15 04:38:33 +0300 |
commit | deba12cd34ad4378465d5691de1d50fe1233121a (patch) | |
tree | 11422217e66ff042bc75eb00563d6c7b1f36e26f /server-tools/instance-manager/instance_options.cc | |
parent | 5bd607785a1f72b826831ab45c99d75b69846531 (diff) | |
download | mariadb-git-deba12cd34ad4378465d5691de1d50fe1233121a.tar.gz |
some more cleanups and fixes
server-tools/instance-manager/commands.cc:
typo fixed
server-tools/instance-manager/instance.cc:
moved options.complete_initialization to the instance::complete_initialization
server-tools/instance-manager/instance.h:
moved options.complete_initialization to the Instance::complete_initialization
server-tools/instance-manager/instance_map.cc:
moved options.complete_initialization to the Instance::complete_initialization, added code to create
default instance if none is given iin config. file
server-tools/instance-manager/instance_map.h:
complete_initialization now returns an error in case of a problem
server-tools/instance-manager/instance_options.cc:
some error handling added
server-tools/instance-manager/instance_options.h:
error handling added
server-tools/instance-manager/manager.cc:
error handling added
server-tools/instance-manager/mysqlmanager.cc:
stop mysqlmanager if options were not loaded correctly
server-tools/instance-manager/options.cc:
return-value added
server-tools/instance-manager/options.h:
return-value added to the OPtions::load()
server-tools/instance-manager/parse_output.cc:
no need to examine mysqld --help -v termination status
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 |