diff options
Diffstat (limited to 'contrib/pg_upgrade/controldata.c')
-rw-r--r-- | contrib/pg_upgrade/controldata.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/pg_upgrade/controldata.c b/contrib/pg_upgrade/controldata.c index 275aeb37907..b0da994c141 100644 --- a/contrib/pg_upgrade/controldata.c +++ b/contrib/pg_upgrade/controldata.c @@ -234,16 +234,20 @@ get_control_data(ClusterInfo *cluster, bool live_check) } else if ((p = strstr(bufin, "Latest checkpoint's NextXID:")) != NULL) { - char *op = strchr(p, '/'); + p = strchr(p, ':'); + + if (p == NULL || strlen(p) <= 1) + pg_log(PG_FATAL, "%d: controldata retrieval problem\n", __LINE__); - if (op == NULL) - op = strchr(p, ':'); + p++; /* removing ':' char */ + cluster->controldata.chkpnt_nxtepoch = str2uint(p); - if (op == NULL || strlen(op) <= 1) + p = strchr(p, '/'); + if (p == NULL || strlen(p) <= 1) pg_log(PG_FATAL, "%d: controldata retrieval problem\n", __LINE__); - op++; /* removing ':' char */ - cluster->controldata.chkpnt_nxtxid = str2uint(op); + p++; /* removing '/' char */ + cluster->controldata.chkpnt_nxtxid = str2uint(p); got_xid = true; } else if ((p = strstr(bufin, "Latest checkpoint's NextOID:")) != NULL) |