summaryrefslogtreecommitdiff
path: root/server-tools/instance-manager/options.cc
diff options
context:
space:
mode:
authorunknown <petr@mysql.com>2005-02-18 14:58:30 +0300
committerunknown <petr@mysql.com>2005-02-18 14:58:30 +0300
commite2d78b85bf004c8c0ec25165d0c9980a3253914a (patch)
treee70177c55262e4cf9599d161b38fb2b72ffb2a8b /server-tools/instance-manager/options.cc
parent31bec292632fb0b77ef20804fea334474e07e326 (diff)
downloadmariadb-git-e2d78b85bf004c8c0ec25165d0c9980a3253914a.tar.gz
made IM to work with --defaults-file smoothly
BitKeeper/deleted/.del-my.cnf~9322f78f12eb2f3c: Delete: support-files/my.cnf include/my_sys.h: fixed prototype to reflect changes in default.c mysys/default.c: use my_search_option_files instead of process_default_option_files. This is used from the IM. server-tools/instance-manager/instance.cc: added parameter to complete_initialization(). this ine marks whether we are creating the only instance (for instance, when no config file given) server-tools/instance-manager/instance.h: prototype changed server-tools/instance-manager/instance_map.cc: Now call my_search_option_files to work smootly with --defaults-file server-tools/instance-manager/instance_map.h: added first_option member. This is set of mysqlmanager was started with --defaults-file or with --extra-defaults-file to be passed to the my_search_option_files server-tools/instance-manager/instance_options.cc: if we have only one instance, name the pidfile `hostname`.pid for compatibility reasons. server-tools/instance-manager/instance_options.h: header fixed according to .cc server-tools/instance-manager/manager.cc: prototype fixed server-tools/instance-manager/options.cc: save --defaults-file of --defaults-extra-file to pass it to my_search_option_files server-tools/instance-manager/options.h: added an optin to save --default-file options support-files/Makefile.am: revert changes
Diffstat (limited to 'server-tools/instance-manager/options.cc')
-rw-r--r--server-tools/instance-manager/options.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/server-tools/instance-manager/options.cc b/server-tools/instance-manager/options.cc
index b136ae3c386..4a9745451a1 100644
--- a/server-tools/instance-manager/options.cc
+++ b/server-tools/instance-manager/options.cc
@@ -37,6 +37,7 @@ const char *Options::pid_file_name= QUOTE(DEFAULT_PID_FILE_NAME);
const char *Options::socket_file_name= QUOTE(DEFAULT_SOCKET_FILE_NAME);
const char *Options::password_file_name= QUOTE(DEFAULT_PASSWORD_FILE_NAME);
const char *Options::default_mysqld_path= QUOTE(DEFAULT_MYSQLD_PATH);
+const char *Options::first_option= 0; /* No default value */
const char *Options::bind_address= 0; /* No default value */
const char *Options::user= 0; /* No default value */
uint Options::monitoring_interval= DEFAULT_MONITORING_INTERVAL;
@@ -210,10 +211,18 @@ C_MODE_END
int Options::load(int argc, char **argv)
{
int rc;
+
+ if (argc >= 2)
+ {
+ if (is_prefix(argv[1],"--defaults-file=") ||
+ is_prefix(argv[1],"--defaults-extra-file="))
+ Options::first_option= argv[1];
+ }
+
/* config-file options are prepended to command-line ones */
load_defaults("my", default_groups, &argc, &argv);
- if (rc= handle_options(&argc, &argv, my_long_options, get_one_option))
+ if ((rc= handle_options(&argc, &argv, my_long_options, get_one_option)) != 0)
return rc;
Options::saved_argv= argv;
return 0;