Commit 94019c87 authored by Michael Paquier's avatar Michael Paquier

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.
parent 8bd064f0
...@@ -1737,7 +1737,8 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn) ...@@ -1737,7 +1737,8 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn)
else else
ereport(ERROR, ereport(ERROR,
(errmsg("could not read file \"%s\": read %d of %zu", (errmsg("could not read file \"%s\": read %d of %zu",
path, readBytes, SnapBuildOnDiskConstantSize))); path, readBytes,
(Size) SnapBuildOnDiskConstantSize)));
} }
if (ondisk.magic != SNAPBUILD_MAGIC) if (ondisk.magic != SNAPBUILD_MAGIC)
......
...@@ -1422,7 +1422,7 @@ RestoreSlotFromDisk(const char *name) ...@@ -1422,7 +1422,7 @@ RestoreSlotFromDisk(const char *name)
ereport(PANIC, ereport(PANIC,
(errmsg("could not read file \"%s\": read %d of %zu", (errmsg("could not read file \"%s\": read %d of %zu",
path, readBytes, path, readBytes,
ReplicationSlotOnDiskConstantSize))); (Size) ReplicationSlotOnDiskConstantSize)));
} }
/* verify magic */ /* verify magic */
......
...@@ -509,7 +509,7 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd) ...@@ -509,7 +509,7 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd)
else if (nread == 0) else if (nread == 0)
ereport(ERROR, ereport(ERROR,
(errmsg("could not read file \"%s\": read %d of %zu", (errmsg("could not read file \"%s\": read %d of %zu",
path, nread, bytesleft))); path, nread, (Size) bytesleft)));
pq_sendbytes(&buf, rbuf, nread); pq_sendbytes(&buf, rbuf, nread);
bytesleft -= nread; bytesleft -= nread;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment