diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2020-09-24 20:45:57 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2020-09-24 21:04:21 +0200 |
commit | c005eb00e7d878cb869854f592103f774e15d01e (patch) | |
tree | 0cc96e69b8be5eeab99b13c1a50058e4612ff50f /src/bin | |
parent | aecf5ee2bb36c597d3c6142e367e38d67816c777 (diff) | |
download | postgresql-c005eb00e7d878cb869854f592103f774e15d01e.tar.gz postgresql-c005eb00e7d878cb869854f592103f774e15d01e.zip |
Standardize the printf format for st_size
Existing code used various inconsistent ways to printf struct stat's
st_size member. The type of that is off_t, which is in most cases a
signed 64-bit integer, so use the long long int format for it.
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/pg_basebackup/pg_receivewal.c | 4 | ||||
-rw-r--r-- | src/bin/pg_verifybackup/pg_verifybackup.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/pg_basebackup/pg_receivewal.c b/src/bin/pg_basebackup/pg_receivewal.c index cd05f5fede1..cddc896390d 100644 --- a/src/bin/pg_basebackup/pg_receivewal.c +++ b/src/bin/pg_basebackup/pg_receivewal.c @@ -269,8 +269,8 @@ FindStreamingStart(uint32 *tli) if (statbuf.st_size != WalSegSz) { - pg_log_warning("segment file \"%s\" has incorrect size %d, skipping", - dirent->d_name, (int) statbuf.st_size); + pg_log_warning("segment file \"%s\" has incorrect size %lld, skipping", + dirent->d_name, (long long int) statbuf.st_size); continue; } } diff --git a/src/bin/pg_verifybackup/pg_verifybackup.c b/src/bin/pg_verifybackup/pg_verifybackup.c index 20140aa0274..bb3733b57e2 100644 --- a/src/bin/pg_verifybackup/pg_verifybackup.c +++ b/src/bin/pg_verifybackup/pg_verifybackup.c @@ -411,8 +411,8 @@ parse_manifest_file(char *manifest_path, manifest_files_hash **ht_p, report_fatal_error("could not read file \"%s\": %m", manifest_path); else - report_fatal_error("could not read file \"%s\": read %d of %zu", - manifest_path, rc, (size_t) statbuf.st_size); + report_fatal_error("could not read file \"%s\": read %d of %lld", + manifest_path, rc, (long long int) statbuf.st_size); } /* Close the manifest file. */ @@ -638,8 +638,8 @@ verify_backup_file(verifier_context *context, char *relpath, char *fullpath) if (m->size != sb.st_size) { report_backup_error(context, - "\"%s\" has size %zu on disk but size %zu in the manifest", - relpath, (size_t) sb.st_size, m->size); + "\"%s\" has size %lld on disk but size %zu in the manifest", + relpath, (long long int) sb.st_size, m->size); m->bad = true; } |