If the user doesn't pass the port on which the primary server is listening

we have to assume it's the DEFAULT_MASTER_PORT.

This was not done, so we added a check to see if it has a value that is
usable, else we use DEFAULT_MASTER_PORT.
This commit is contained in:
Martín Marqués
2014-09-29 16:06:05 -03:00
committed by Jaime Casanova
parent d3c067f1bd
commit 07a216ca25

View File

@@ -288,6 +288,12 @@ main(int argc, char **argv)
strncpy(runtime_options.dbname, DEFAULT_DBNAME, MAXLEN);
}
/* We check that port number is not null */
if (!runtime_options.dbname[0])
{
strncpy(runtime_options.masterport, DEFAULT_MASTER_PORT, MAXLEN);
}
/* Read the configuration file, normally repmgr.conf */
if (!runtime_options.config_file[0])
strncpy(runtime_options.config_file, DEFAULT_CONFIG_FILE, MAXLEN);