1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

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)
This commit is contained in:
unknown
2004-11-02 10:11:03 +03:00
parent 3691a8a426
commit 7a3a757fd5
13 changed files with 142 additions and 115 deletions

View File

@ -93,13 +93,16 @@ static void delete_user(void *u)
C_MODE_END
User_map::User_map()
int User_map::init()
{
enum { START_HASH_SIZE = 16 };
hash_init(&hash, default_charset_info, START_HASH_SIZE, 0, 0,
get_user_key, delete_user, 0);
if (hash_init(&hash, default_charset_info, START_HASH_SIZE, 0, 0,
get_user_key, delete_user, 0))
return 1;
return 0;
}
User_map::~User_map()
{
hash_free(&hash);
@ -134,7 +137,8 @@ int User_map::load(const char *password_file_name)
while (fgets(line, sizeof(line), file))
{
/* skip comments and empty lines */
if (line[0] == '#' || line[0] == '\n' && line[1] == '\0')
if (line[0] == '#' || line[0] == '\n' &&
(line[1] == '\0' || line[1] == '\r'))
continue;
if ((user= new User) == 0)
goto done;