Formatting updates before pgindent run

This commit is contained in:
Ian Barwick
2017-09-11 11:04:51 +09:00
parent c9f3f971e2
commit 0e6699ecb6
2 changed files with 100 additions and 54 deletions

View File

@@ -221,7 +221,10 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
/* Initialize configuration options with sensible defaults */ /* Initialize configuration options with sensible defaults */
/* node information */ /*-----------------
* node information
*-----------------
*/
options->node_id = UNKNOWN_NODE_ID; options->node_id = UNKNOWN_NODE_ID;
memset(options->node_name, 0, sizeof(options->node_name)); memset(options->node_name, 0, sizeof(options->node_name));
memset(options->conninfo, 0, sizeof(options->conninfo)); memset(options->conninfo, 0, sizeof(options->conninfo));
@@ -229,18 +232,21 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
memset(options->pg_bindir, 0, sizeof(options->pg_bindir)); memset(options->pg_bindir, 0, sizeof(options->pg_bindir));
options->replication_type = REPLICATION_TYPE_PHYSICAL; options->replication_type = REPLICATION_TYPE_PHYSICAL;
/* /*-------------
* log settings * log settings
* *
* note: the default for "log_level" is set in log.c and does not need * note: the default for "log_level" is set in log.c and does not need
* to be initialised here * to be initialised here
*-------------
*/ */
memset(options->log_facility, 0, sizeof(options->log_facility)); memset(options->log_facility, 0, sizeof(options->log_facility));
memset(options->log_file, 0, sizeof(options->log_file)); memset(options->log_file, 0, sizeof(options->log_file));
options->log_status_interval = DEFAULT_LOG_STATUS_INTERVAL; options->log_status_interval = DEFAULT_LOG_STATUS_INTERVAL;
/* standby action settings /*-----------------------
* ----------------------- */ * standby action settings
*------------------------
*/
options->use_replication_slots = false; options->use_replication_slots = false;
memset(options->rsync_options, 0, sizeof(options->rsync_options)); memset(options->rsync_options, 0, sizeof(options->rsync_options));
memset(options->ssh_options, 0, sizeof(options->ssh_options)); memset(options->ssh_options, 0, sizeof(options->ssh_options));
@@ -253,8 +259,10 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
memset(options->recovery_min_apply_delay, 0, sizeof(options->recovery_min_apply_delay)); memset(options->recovery_min_apply_delay, 0, sizeof(options->recovery_min_apply_delay));
options->use_primary_conninfo_password = false; options->use_primary_conninfo_password = false;
/* repmgrd settings /*-----------------
* ---------------- */ * repmgrd settings
*-----------------
*/
options->failover = FAILOVER_MANUAL; options->failover = FAILOVER_MANUAL;
options->priority = DEFAULT_PRIORITY; options->priority = DEFAULT_PRIORITY;
memset(options->location, 0, sizeof(options->location)); memset(options->location, 0, sizeof(options->location));
@@ -271,13 +279,17 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
options->primary_notification_timeout = DEFAULT_PRIMARY_NOTIFICATION_TIMEOUT; options->primary_notification_timeout = DEFAULT_PRIMARY_NOTIFICATION_TIMEOUT;
options->primary_follow_timeout = DEFAULT_PRIMARY_FOLLOW_TIMEOUT; options->primary_follow_timeout = DEFAULT_PRIMARY_FOLLOW_TIMEOUT;
/* BDR settings /*-------------
* ------------ */ * BDR settings
*-------------
*/
options->bdr_local_monitoring_only = false; options->bdr_local_monitoring_only = false;
options->bdr_recovery_timeout = DEFAULT_BDR_RECOVERY_TIMEOUT; options->bdr_recovery_timeout = DEFAULT_BDR_RECOVERY_TIMEOUT;
/* service settings /*-----------------
* ---------------- */ * service settings
*-----------------
*/
memset(options->pg_ctl_options, 0, sizeof(options->pg_ctl_options)); memset(options->pg_ctl_options, 0, sizeof(options->pg_ctl_options));
memset(options->service_stop_command, 0, sizeof(options->service_stop_command)); memset(options->service_stop_command, 0, sizeof(options->service_stop_command));
memset(options->service_start_command, 0, sizeof(options->service_start_command)); memset(options->service_start_command, 0, sizeof(options->service_start_command));
@@ -285,19 +297,25 @@ _parse_config(t_configuration_options *options, ItemList *error_list, ItemList *
memset(options->service_reload_command, 0, sizeof(options->service_reload_command)); memset(options->service_reload_command, 0, sizeof(options->service_reload_command));
memset(options->service_promote_command, 0, sizeof(options->service_promote_command)); memset(options->service_promote_command, 0, sizeof(options->service_promote_command));
/* event notification settings /*----------------------------
* --------------------------- */ * event notification settings
*----------------------------
*/
memset(options->event_notification_command, 0, sizeof(options->event_notification_command)); memset(options->event_notification_command, 0, sizeof(options->event_notification_command));
options->event_notifications.head = NULL; options->event_notifications.head = NULL;
options->event_notifications.tail = NULL; options->event_notifications.tail = NULL;
/* barman settings */ /*----------------
/* --------------- */ * barman settings
* ---------------
*/
memset(options->barman_server, 0, sizeof(options->barman_server)); memset(options->barman_server, 0, sizeof(options->barman_server));
memset(options->barman_config, 0, sizeof(options->barman_config)); memset(options->barman_config, 0, sizeof(options->barman_config));
/* undocumented test settings */ /*---------------------------
/* -------------------------- */ * undocumented test settings
*---------------------------
*/
options->promote_delay = 0; options->promote_delay = 0;
/* /*

View File

@@ -209,8 +209,10 @@ main(int argc, char **argv)
printf("%s %s\n", progname(), REPMGR_VERSION); printf("%s %s\n", progname(), REPMGR_VERSION);
exit(SUCCESS); exit(SUCCESS);
/* general configuration options /*------------------------------
* ----------------------------- */ * general configuration options
*------------------------------
*/
/* -b/--pg_bindir */ /* -b/--pg_bindir */
case 'b': case 'b':
@@ -242,8 +244,10 @@ main(int argc, char **argv)
runtime_options.wait = true; runtime_options.wait = true;
break; break;
/* database connection options */ /*----------------------------
/* --------------------------- */ * database connection options
*----------------------------
*/
/* /*
* These are the standard database connection options; with the * These are the standard database connection options; with the
@@ -283,8 +287,10 @@ main(int argc, char **argv)
runtime_options.connection_param_provided = true; runtime_options.connection_param_provided = true;
break; break;
/* other connection options */ /*-------------------------
/* ------------------------ */ * other connection options
*-------------------------
*/
/* -R/--remote_user */ /* -R/--remote_user */
case 'R': case 'R':
@@ -296,8 +302,10 @@ main(int argc, char **argv)
strncpy(runtime_options.superuser, optarg, MAXLEN); strncpy(runtime_options.superuser, optarg, MAXLEN);
break; break;
/* node options * /*-------------
* ------------ */ * node options
*-------------
*/
/* -D/--pgdata/--data-dir */ /* -D/--pgdata/--data-dir */
case 'D': case 'D':
@@ -322,8 +330,10 @@ main(int argc, char **argv)
runtime_options.upstream_node_id = repmgr_atoi(optarg, "--upstream-node-id", &cli_errors, false); runtime_options.upstream_node_id = repmgr_atoi(optarg, "--upstream-node-id", &cli_errors, false);
break; break;
/* "standby clone" options * /*------------------------
* ----------------------- */ * "standby clone" options
*------------------------
*/
/* -c/--fast-checkpoint */ /* -c/--fast-checkpoint */
case 'c': case 'c':
@@ -366,8 +376,10 @@ main(int argc, char **argv)
runtime_options.without_barman = true; runtime_options.without_barman = true;
break; break;
/* "standby register" options * /*---------------------------
* -------------------------- */ * "standby register" options
*---------------------------
*/
case OPT_REGISTER_WAIT: case OPT_REGISTER_WAIT:
runtime_options.wait_register_sync = true; runtime_options.wait_register_sync = true;
@@ -377,8 +389,10 @@ main(int argc, char **argv)
} }
break; break;
/* "standby switchover" options * /*-----------------------------
* ---------------------------- */ * "standby switchover" options
*-----------------------------
*/
case OPT_ALWAYS_PROMOTE: case OPT_ALWAYS_PROMOTE:
runtime_options.always_promote = true; runtime_options.always_promote = true;
@@ -392,15 +406,19 @@ main(int argc, char **argv)
runtime_options.siblings_follow = true; runtime_options.siblings_follow = true;
break; break;
/* "node status" options * /*----------------------
* --------------------- */ * "node status" options
*----------------------
*/
case OPT_IS_SHUTDOWN_CLEANLY: case OPT_IS_SHUTDOWN_CLEANLY:
runtime_options.is_shutdown_cleanly = true; runtime_options.is_shutdown_cleanly = true;
break; break;
/* "node check" options * /*---------------------
* --------------------- */ * "node check" options
*--------------------
*/
case OPT_ARCHIVE_READY: case OPT_ARCHIVE_READY:
runtime_options.archive_ready = true; runtime_options.archive_ready = true;
break; break;
@@ -421,14 +439,24 @@ main(int argc, char **argv)
runtime_options.slots = true; runtime_options.slots = true;
break; break;
/* "node join" options * /*--------------------
* ------------------- */ * "node rejoin" options
*--------------------
*/
case OPT_CONFIG_FILES: case OPT_CONFIG_FILES:
strncpy(runtime_options.config_files, optarg, MAXLEN); strncpy(runtime_options.config_files, optarg, MAXLEN);
break; break;
/* "node service" options * /* internal options */
* ---------------------- */ case OPT_CONFIG_ARCHIVE_DIR:
/* TODO: check this is an absolute path */
strncpy(runtime_options.config_archive_dir, optarg, MAXPGPATH);
break;
/*-----------------------
* "node service" options
*-----------------------
*/
/* --action (repmgr node service --action) */ /* --action (repmgr node service --action) */
case OPT_ACTION: case OPT_ACTION:
@@ -447,8 +475,10 @@ main(int argc, char **argv)
runtime_options.checkpoint = true; runtime_options.checkpoint = true;
break; break;
/* "cluster event" options * /*------------------------
* ----------------------- */ * "cluster event" options
*------------------------
*/
case OPT_EVENT: case OPT_EVENT:
strncpy(runtime_options.event, optarg, MAXLEN); strncpy(runtime_options.event, optarg, MAXLEN);
@@ -463,10 +493,10 @@ main(int argc, char **argv)
runtime_options.all = true; runtime_options.all = true;
break; break;
/*----------------
* logging options
/* logging options * *----------------
* --------------- */ */
/* -L/--log-level */ /* -L/--log-level */
case 'L': case 'L':
@@ -504,8 +534,10 @@ main(int argc, char **argv)
break; break;
/* output options */ /*--------------
/* -------------- */ * output options
*---------------
*/
case OPT_CSV: case OPT_CSV:
runtime_options.csv = true; runtime_options.csv = true;
break; break;
@@ -518,14 +550,10 @@ main(int argc, char **argv)
runtime_options.optformat = true; runtime_options.optformat = true;
break; break;
/* internal options */ /*-----------------------------
case OPT_CONFIG_ARCHIVE_DIR: * options deprecated since 3.3
/* TODO: check this is an absolute path */ *-----------------------------
strncpy(runtime_options.config_archive_dir, optarg, MAXPGPATH); */
break;
/* options deprecated since 3.3 *
* ---------------------------- */
case OPT_DATA_DIR: case OPT_DATA_DIR:
item_list_append(&cli_warnings, item_list_append(&cli_warnings,
_("--data-dir is deprecated; use -D/--pgdata instead")); _("--data-dir is deprecated; use -D/--pgdata instead"));