From 94019c879a138454af723fa8bfc346d4a44ecd47 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 18 Jul 2018 09:51:53 +0900 Subject: [PATCH] Fix more portability issues with casts to Size when using off_t This should tame the beast, as there are no other places where off_t is used in the new error messages. Reported again by longfin, which complained about walsender.c while I spotted the other two ones while double-checking. --- src/backend/replication/logical/snapbuild.c | 3 ++- src/backend/replication/slot.c | 2 +- src/backend/replication/walsender.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/replication/logical/snapbuild.c b/src/backend/replication/logical/snapbuild.c index 61bc9e8f147..7bd969b0a1c 100644 --- a/src/backend/replication/logical/snapbuild.c +++ b/src/backend/replication/logical/snapbuild.c @@ -1737,7 +1737,8 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn) else ereport(ERROR, (errmsg("could not read file \"%s\": read %d of %zu", - path, readBytes, SnapBuildOnDiskConstantSize))); + path, readBytes, + (Size) SnapBuildOnDiskConstantSize))); } if (ondisk.magic != SNAPBUILD_MAGIC) diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c index afbaf8c80d8..271af08572a 100644 --- a/src/backend/replication/slot.c +++ b/src/backend/replication/slot.c @@ -1422,7 +1422,7 @@ RestoreSlotFromDisk(const char *name) ereport(PANIC, (errmsg("could not read file \"%s\": read %d of %zu", path, readBytes, - ReplicationSlotOnDiskConstantSize))); + (Size) ReplicationSlotOnDiskConstantSize))); } /* verify magic */ diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index e3df5495c33..76954831cee 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -509,7 +509,7 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd) else if (nread == 0) ereport(ERROR, (errmsg("could not read file \"%s\": read %d of %zu", - path, nread, bytesleft))); + path, nread, (Size) bytesleft))); pq_sendbytes(&buf, rbuf, nread); bytesleft -= nread;