Skip to content

Commit 94019c8

Browse files
committed
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.
1 parent 8bd064f commit 94019c8

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/backend/replication/logical/snapbuild.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,8 @@ SnapBuildRestore(SnapBuild *builder, XLogRecPtr lsn)
17371737
else
17381738
ereport(ERROR,
17391739
(errmsg("could not read file \"%s\": read %d of %zu",
1740-
path, readBytes, SnapBuildOnDiskConstantSize)));
1740+
path, readBytes,
1741+
(Size) SnapBuildOnDiskConstantSize)));
17411742
}
17421743

17431744
if (ondisk.magic != SNAPBUILD_MAGIC)

src/backend/replication/slot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ RestoreSlotFromDisk(const char *name)
14221422
ereport(PANIC,
14231423
(errmsg("could not read file \"%s\": read %d of %zu",
14241424
path, readBytes,
1425-
ReplicationSlotOnDiskConstantSize)));
1425+
(Size) ReplicationSlotOnDiskConstantSize)));
14261426
}
14271427

14281428
/* verify magic */

src/backend/replication/walsender.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd)
509509
else if (nread == 0)
510510
ereport(ERROR,
511511
(errmsg("could not read file \"%s\": read %d of %zu",
512-
path, nread, bytesleft)));
512+
path, nread, (Size) bytesleft)));
513513

514514
pq_sendbytes(&buf, rbuf, nread);
515515
bytesleft -= nread;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy