mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
Unwind some workarounds for lack of portable int64 format specifier
Because there is no portable int64/uint64 format specifier and we can't stick macros like INT64_FORMAT into the middle of a translatable string, we have been using various workarounds that put the number to be printed into a string buffer first. Now that we always use our own sprintf(), we can rely on %lld and %llu to work, so we can use those. This patch undoes this workaround in a few places where it was egregiously verbose. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/CAH2-Wz%3DWbNxc5ob5NJ9yqo2RMJ0q4HXDS30GVCobeCvC9A1L9A%40mail.gmail.com
This commit is contained in:
@ -106,7 +106,7 @@ static TimestampTz throttled_last;
|
||||
static XLogRecPtr startptr;
|
||||
|
||||
/* Total number of checksum failures during base backup. */
|
||||
static int64 total_checksum_failures;
|
||||
static long long int total_checksum_failures;
|
||||
|
||||
/* Do not verify checksums. */
|
||||
static bool noverify_checksums = false;
|
||||
@ -607,14 +607,9 @@ perform_base_backup(basebackup_options *opt)
|
||||
if (total_checksum_failures)
|
||||
{
|
||||
if (total_checksum_failures > 1)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
snprintf(buf, sizeof(buf), INT64_FORMAT, total_checksum_failures);
|
||||
|
||||
ereport(WARNING,
|
||||
(errmsg("%s total checksum verification failures", buf)));
|
||||
}
|
||||
(errmsg("%lld total checksum verification failures", total_checksum_failures)));
|
||||
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATA_CORRUPTED),
|
||||
errmsg("checksum verification failure during base backup")));
|
||||
|
Reference in New Issue
Block a user