Skip to content

Commit cb64313

Browse files
committed
add double quotes to filenames in elog messages
1 parent 7121f04 commit cb64313

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/data.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ read_page_from_file(pgFile *file, BlockNumber blknum,
209209
/* The block could have been truncated. It is fine. */
210210
if (read_len == 0)
211211
{
212-
elog(VERBOSE, "File %s, block %u, file was truncated",
212+
elog(VERBOSE, "File \"%s\", block %u, file was truncated",
213213
file->path, blknum);
214214
return 0;
215215
}
216216
else
217217
{
218-
elog(WARNING, "File: %s, block %u, expected block size %u,"
218+
elog(WARNING, "File: \"%s\", block %u, expected block size %u,"
219219
"but read %zu, try again",
220220
file->path, blknum, BLCKSZ, read_len);
221221
return -1;
@@ -238,15 +238,15 @@ read_page_from_file(pgFile *file, BlockNumber blknum,
238238
/* Page is zeroed. No need to check header and checksum. */
239239
if (i == BLCKSZ)
240240
{
241-
elog(VERBOSE, "File: %s blknum %u, empty page", file->path, blknum);
241+
elog(VERBOSE, "File: \"%s\" blknum %u, empty page", file->path, blknum);
242242
return 1;
243243
}
244244

245245
/*
246246
* If page is not completely empty and we couldn't parse it,
247247
* try again several times. If it didn't help, throw error
248248
*/
249-
elog(LOG, "File: %s blknum %u have wrong page header, try again",
249+
elog(LOG, "File: \"%s\" blknum %u have wrong page header, try again",
250250
file->path, blknum);
251251
return -1;
252252
}
@@ -261,7 +261,7 @@ read_page_from_file(pgFile *file, BlockNumber blknum,
261261
*/
262262
if (pg_checksum_page(page, blkno) != ((PageHeader) page)->pd_checksum)
263263
{
264-
elog(LOG, "File: %s blknum %u have wrong checksum, try again",
264+
elog(LOG, "File: \"%s\" blknum %u have wrong checksum, try again",
265265
file->path, blknum);
266266
return -1;
267267
}
@@ -342,7 +342,7 @@ prepare_page(ConnectionArgs *arguments,
342342

343343
if (result == -1 && is_ptrack_support && strict)
344344
{
345-
elog(WARNING, "File %s, block %u, try to fetch via SQL",
345+
elog(WARNING, "File \"%s\", block %u, try to fetch via SQL",
346346
file->path, blknum);
347347
break;
348348
}
@@ -389,7 +389,7 @@ prepare_page(ConnectionArgs *arguments,
389389
else if (page_size != BLCKSZ)
390390
{
391391
free(ptrack_page);
392-
elog(ERROR, "File: %s, block %u, expected block size %d, but read %zu",
392+
elog(ERROR, "File: \"%s\", block %u, expected block size %d, but read %zu",
393393
file->path, absolute_blknum, BLCKSZ, page_size);
394394
}
395395
else
@@ -422,7 +422,7 @@ prepare_page(ConnectionArgs *arguments,
422422
page_lsn &&
423423
page_lsn < prev_backup_start_lsn)
424424
{
425-
elog(VERBOSE, "Skipping blknum %u in file: %s", blknum, file->path);
425+
elog(VERBOSE, "Skipping blknum %u in file: \"%s\"", blknum, file->path);
426426
(*n_skipped)++;
427427
return SkipCurrentPage;
428428
}
@@ -505,7 +505,7 @@ compress_and_backup_page(pgFile *file, BlockNumber blknum,
505505

506506
fclose(in);
507507
fio_fclose(out);
508-
elog(ERROR, "File: %s, cannot write backup at block %u: %s",
508+
elog(ERROR, "File: \"%s\", cannot write backup at block %u: %s",
509509
file->path, blknum, strerror(errno_tmp));
510510
}
511511

@@ -549,7 +549,7 @@ backup_data_file(backup_files_arg* arguments,
549549
* There are no changed blocks since last backup. We want make
550550
* incremental backup, so we should exit.
551551
*/
552-
elog(VERBOSE, "Skipping the unchanged file: %s", file->path);
552+
elog(VERBOSE, "Skipping the unchanged file: \"%s\"", file->path);
553553
return false;
554554
}
555555

@@ -1298,7 +1298,7 @@ check_file_pages(pgFile *file, XLogRecPtr stop_lsn, uint32 checksum_version,
12981298
pg_crc32 crc;
12991299
bool use_crc32c = backup_version <= 20021 || backup_version >= 20025;
13001300

1301-
elog(VERBOSE, "Validate relation blocks for file %s", file->path);
1301+
elog(VERBOSE, "Validate relation blocks for file \"%s\"", file->path);
13021302

13031303
in = fopen(file->path, PG_BINARY_R);
13041304
if (in == NULL)

0 commit comments

Comments
 (0)