summaryrefslogtreecommitdiff
path: root/src/bin/pg_combinebackup/write_manifest.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2024-10-02 09:59:04 -0400
committerRobert Haas <rhaas@postgresql.org>2024-10-02 09:59:04 -0400
commitd94cf5ca7fad9cd81af5eac491bfbaf0facb9f6f (patch)
tree757c737bd7d37a01707f15a57257b1f0b34dabb8 /src/bin/pg_combinebackup/write_manifest.c
parent7b2822ecf944a6aa429c05cc7f070001c3817934 (diff)
File size in a backup manifest should use uint64, not size_t.
size_t is the size of an object in memory, not the size of a file on disk. Thanks to Tom Lane for noting the error. Discussion: http://postgr.es/m/1865585.1727803933@sss.pgh.pa.us
Diffstat (limited to 'src/bin/pg_combinebackup/write_manifest.c')
-rw-r--r--src/bin/pg_combinebackup/write_manifest.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/pg_combinebackup/write_manifest.c b/src/bin/pg_combinebackup/write_manifest.c
index 369d6d2071c..6fea07e7c64 100644
--- a/src/bin/pg_combinebackup/write_manifest.c
+++ b/src/bin/pg_combinebackup/write_manifest.c
@@ -74,7 +74,7 @@ create_manifest_writer(char *directory, uint64 system_identifier)
*/
void
add_file_to_manifest(manifest_writer *mwriter, const char *manifest_path,
- size_t size, time_t mtime,
+ uint64 size, time_t mtime,
pg_checksum_type checksum_type,
int checksum_length,
uint8 *checksum_payload)
@@ -104,7 +104,8 @@ add_file_to_manifest(manifest_writer *mwriter, const char *manifest_path,
appendStringInfoString(&mwriter->buf, "\", ");
}
- appendStringInfo(&mwriter->buf, "\"Size\": %zu, ", size);
+ appendStringInfo(&mwriter->buf, "\"Size\": %llu, ",
+ (unsigned long long) size);
appendStringInfoString(&mwriter->buf, "\"Last-Modified\": \"");
enlargeStringInfo(&mwriter->buf, 128);