Below is the list of changes that have just been committed into a local
5.1 repository of alik. When alik does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-02-08 23:38:01+03:00, anozdrin@stripped +2 -0
Polishing: move logical part of code into a function.
server-tools/instance-manager/manager.cc@stripped, 2007-02-08 23:37:59+03:00, anozdrin@stripped +50 -28
Polishing: move logical part of code into a function.
server-tools/instance-manager/manager.h@stripped, 2007-02-08 23:37:59+03:00, anozdrin@stripped +1 -0
Polishing: move logical part of code into a function.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: anozdrin
# Host: alik.opbmk
# Root: /mnt/raid/alik/MySQL/devel/5.1-rt-im
--- 1.48/server-tools/instance-manager/manager.cc 2007-02-08 23:38:06 +03:00
+++ 1.49/server-tools/instance-manager/manager.cc 2007-02-08 23:38:06 +03:00
@@ -186,6 +186,53 @@ void Manager::stop_all_threads()
/**
+ Initialize user map and load password file.
+
+ SYNOPSIS
+ init_user_map()
+
+ RETURN
+ FALSE on success
+ TRUE on failure
+*/
+
+bool Manager::init_user_map(User_map *user_map)
+{
+ int err_code;
+ const char *err_msg;
+
+ if (user_map->init())
+ {
+ log_error("Manager: can not initialize user list: out of memory.");
+ return TRUE;
+ }
+
+ err_code= user_map->load(Options::Main::password_file_name, &err_msg);
+
+ if (!err_code)
+ return FALSE;
+
+ if (err_code == ERR_PASSWORD_FILE_DOES_NOT_EXIST &&
+ Options::Main::mysqld_safe_compatible)
+ {
+ /*
+ The password file does not exist, but we are running in
+ mysqld_safe-compatible mode. Continue, but complain in log.
+ */
+
+ log_info("Warning: password file does not exist, "
+ "nobody will be able to connect to Instance Manager.");
+
+ return FALSE;
+ }
+
+ log_error("Manager: %s.", (const char *) err_msg);
+
+ return TRUE;
+}
+
+
+/**
Main manager function.
SYNOPSIS
@@ -203,8 +250,6 @@ void Manager::stop_all_threads()
int Manager::main()
{
- int err_code;
- const char *err_msg;
bool shutdown_complete= FALSE;
pid_t manager_pid= getpid();
@@ -259,33 +304,10 @@ int Manager::main()
return 1;
}
- /* Initialize user map and load password file. */
-
- if (user_map.init())
- {
- log_error("Manager: can not initialize user list: out of memory.");
- return 1;
- }
+ /* Initialize user db. */
- if ((err_code= user_map.load(Options::Main::password_file_name, &err_msg)))
- {
- if (err_code == ERR_PASSWORD_FILE_DOES_NOT_EXIST &&
- Options::Main::mysqld_safe_compatible)
- {
- /*
- The password file does not exist, but we are running in
- mysqld_safe-compatible mode. Continue, but complain in log.
- */
-
- log_info("Warning: password file does not exist, "
- "nobody will be able to connect to Instance Manager.");
- }
- else
- {
- log_error("Manager: %s.", (const char *) err_msg);
- return 1;
- }
- }
+ if (init_user_map(&user_map))
+ return 1; /* logging has been already done. */
/* Write Instance Manager pid file. */
--- 1.12/server-tools/instance-manager/manager.h 2007-02-08 23:38:07 +03:00
+++ 1.13/server-tools/instance-manager/manager.h 2007-02-08 23:38:07 +03:00
@@ -51,6 +51,7 @@ public:
private:
static void stop_all_threads();
+ static bool init_user_map(User_map *user_map);
private:
static Guardian *p_guardian;
| Thread |
|---|
| • bk commit into 5.1 tree (anozdrin:1.2413) | Alexander Nozdrin | 8 Feb |