From 7a3a757fd5169cda75c2130cdd30457f7c8d2ee8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 10:11:03 +0300 Subject: post-review fixes server-tools/instance-manager/Makefile.am: Removed entry for deleted file server-tools/instance-manager/buffer.cc: cleanup server-tools/instance-manager/commands.cc: cleanup, added missing error handling server-tools/instance-manager/instance.cc: added waitpid in instance_start, added few checks server-tools/instance-manager/instance_map.cc: error handling for hash_init added server-tools/instance-manager/instance_map.h: Extended constructor server-tools/instance-manager/instance_options.cc: made add_option less bulky server-tools/instance-manager/instance_options.h: - server-tools/instance-manager/listener.cc: added missing close, fixed typo server-tools/instance-manager/manager.cc: moved some Instance_map initialization to costructor server-tools/instance-manager/protocol.cc: error handling added server-tools/instance-manager/protocol.h: store_to_string fixed to return a value server-tools/instance-manager/user_map.cc: error handling for hash_init added server-tools/instance-manager/user_map.h: added init() for User map (becouse of the hash_init check) --- server-tools/instance-manager/instance_map.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'server-tools/instance-manager/instance_map.cc') diff --git a/server-tools/instance-manager/instance_map.cc b/server-tools/instance-manager/instance_map.cc index b70f622fa73..12f0c799d50 100644 --- a/server-tools/instance-manager/instance_map.cc +++ b/server-tools/instance-manager/instance_map.cc @@ -110,14 +110,26 @@ err_new_instance: C_MODE_END -Instance_map::Instance_map() +Instance_map::Instance_map(const char *default_mysqld_path_arg, + const char *default_admin_user_arg, + const char *default_admin_password_arg) { - hash_init(&hash, default_charset_info, START_HASH_SIZE, 0, 0, - get_instance_key, delete_instance, 0); + mysqld_path= default_mysqld_path_arg; + user= default_admin_user_arg; + password= default_admin_password_arg; + pthread_mutex_init(&LOCK_instance_map, 0); } +int Instance_map::init() +{ + if (hash_init(&hash, default_charset_info, START_HASH_SIZE, 0, 0, + get_instance_key, delete_instance, 0)) + return 1; + return 0; +} + Instance_map::~Instance_map() { pthread_mutex_lock(&LOCK_instance_map); -- cgit v1.2.1