Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 126db4a

Browse files
committed
Make compiler happy
1 parent 0985222 commit 126db4a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/data.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,9 @@ restore_data_file(const char *from_root,
602602
* Backup contains information that this block was truncated.
603603
* Truncate file to this length.
604604
*/
605-
ftruncate(fileno(out), header.block * BLCKSZ);
605+
if (ftruncate(fileno(out), header.block * BLCKSZ) != 0)
606+
elog(ERROR, "cannot truncate \"%s\": %s",
607+
file->path, strerror(errno));
606608
elog(VERBOSE, "truncate file %s to block %u", file->path, header.block);
607609
break;
608610
}

src/show.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,22 +139,22 @@ pretty_size(int64 size, char *buf, size_t len)
139139
switch (exp)
140140
{
141141
case 0:
142-
snprintf(buf, len, INT64_FORMAT "B", size);
142+
snprintf(buf, len, "%dB", (int) size);
143143
break;
144144
case 1:
145-
snprintf(buf, len, INT64_FORMAT "kB", size);
145+
snprintf(buf, len, "%dkB", (int) size);
146146
break;
147147
case 2:
148-
snprintf(buf, len, INT64_FORMAT "MB", size);
148+
snprintf(buf, len, "%dMB", (int) size);
149149
break;
150150
case 3:
151-
snprintf(buf, len, INT64_FORMAT "GB", size);
151+
snprintf(buf, len, "%dGB", (int) size);
152152
break;
153153
case 4:
154-
snprintf(buf, len, INT64_FORMAT "TB", size);
154+
snprintf(buf, len, "%dTB", (int) size);
155155
break;
156156
case 5:
157-
snprintf(buf, len, INT64_FORMAT "PB", size);
157+
snprintf(buf, len, "%dPB", (int) size);
158158
break;
159159
default:
160160
strncpy(buf, "***", len);
@@ -250,7 +250,7 @@ show_backup_list(FILE *out, parray *backup_list)
250250
* the difference of data accumulated.
251251
*/
252252
pretty_size(backup->data_bytes, data_bytes_str,
253-
lengthof(data_bytes_str));
253+
lengthof(data_bytes_str));
254254

255255
/* Get parent timeline before printing */
256256
parent_tli = get_parent_tli(backup->tli);

0 commit comments

Comments
 (0)