From d728ef0eef816926e55cf1fdf75704fb1943404d Mon Sep 17 00:00:00 2001 From: postgres Date: Tue, 14 Sep 2010 03:05:28 -0500 Subject: [PATCH] Fix some typos and replace the variable Inrecovery with the function RecoveryInProgress() in the function sql_utils/repmgr_wrapper_funcs.c:last_xlog_replay_timestamp() --- config.c | 2 +- main.c | 2 +- sql_utils/repmgr_wrapper_funcs.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.c b/config.c index e0b1225d..3d0359f6 100644 --- a/config.c +++ b/config.c @@ -31,7 +31,7 @@ parse_config(char *cluster_name, int *node, char *conninfo) /* Copy into correct entry in parameters struct */ if (strcmp(name, "cluster") == 0) - *node = atoi(value); + strncpy (cluster_name, value, MAXLEN); else if (strcmp(name, "node") == 0) *node = atoi(value); else if (strcmp(name, "conninfo") == 0) diff --git a/main.c b/main.c index 3f47aaa6..342e84d6 100644 --- a/main.c +++ b/main.c @@ -123,7 +123,7 @@ getPrimaryConnection(void) for (i = 0; i < PQntuples(res1); i++) { primaryId = atoi(PQgetvalue(res1, i, 0)); - strcmp(primaryConninfo, PQgetvalue(res1, i, 2)); + strcpy(primaryConninfo, PQgetvalue(res1, i, 2)); primaryConn = establishDBConnection(primaryConninfo, false); res2 = PQexec(primaryConn, "SELECT pg_is_in_recovery()"); diff --git a/sql_utils/repmgr_wrapper_funcs.c b/sql_utils/repmgr_wrapper_funcs.c index 3278e34d..1624551b 100644 --- a/sql_utils/repmgr_wrapper_funcs.c +++ b/sql_utils/repmgr_wrapper_funcs.c @@ -21,7 +21,7 @@ last_xlog_replay_timestamp(PG_FUNCTION_ARGS) TimestampTz rTime; bool fromStream; - if (!InRecovery) + if (!RecoveryInProgress()) PG_RETURN_NULL(); else {