1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-02 09:53:24 +02:00

Make compiler happy

This commit is contained in:
Arthur Zakirov 2018-02-12 18:39:50 +03:00
parent 0985222c3c
commit 126db4a202
2 changed files with 10 additions and 8 deletions

View File

@ -602,7 +602,9 @@ restore_data_file(const char *from_root,
* Backup contains information that this block was truncated.
* Truncate file to this length.
*/
ftruncate(fileno(out), header.block * BLCKSZ);
if (ftruncate(fileno(out), header.block * BLCKSZ) != 0)
elog(ERROR, "cannot truncate \"%s\": %s",
file->path, strerror(errno));
elog(VERBOSE, "truncate file %s to block %u", file->path, header.block);
break;
}

View File

@ -139,22 +139,22 @@ pretty_size(int64 size, char *buf, size_t len)
switch (exp)
{
case 0:
snprintf(buf, len, INT64_FORMAT "B", size);
snprintf(buf, len, "%dB", (int) size);
break;
case 1:
snprintf(buf, len, INT64_FORMAT "kB", size);
snprintf(buf, len, "%dkB", (int) size);
break;
case 2:
snprintf(buf, len, INT64_FORMAT "MB", size);
snprintf(buf, len, "%dMB", (int) size);
break;
case 3:
snprintf(buf, len, INT64_FORMAT "GB", size);
snprintf(buf, len, "%dGB", (int) size);
break;
case 4:
snprintf(buf, len, INT64_FORMAT "TB", size);
snprintf(buf, len, "%dTB", (int) size);
break;
case 5:
snprintf(buf, len, INT64_FORMAT "PB", size);
snprintf(buf, len, "%dPB", (int) size);
break;
default:
strncpy(buf, "***", len);
@ -250,7 +250,7 @@ show_backup_list(FILE *out, parray *backup_list)
* the difference of data accumulated.
*/
pretty_size(backup->data_bytes, data_bytes_str,
lengthof(data_bytes_str));
lengthof(data_bytes_str));
/* Get parent timeline before printing */
parent_tli = get_parent_tli(backup->tli);