@@ -514,6 +514,9 @@ dir_list_file(parray *files, const char *root, bool exclude, bool follow_symlink
514514 parray_append (black_list , pgut_strdup (black_item ));
515515 }
516516
517+ if (ferror (black_list_file ))
518+ elog (ERROR , "Failed to read from file: \"%s\"" , path );
519+
517520 fio_close_stream (black_list_file );
518521 parray_qsort (black_list , BlackListCompare );
519522 }
@@ -1154,6 +1157,9 @@ read_tablespace_map(parray *files, const char *backup_dir)
11541157 parray_append (files , file );
11551158 }
11561159
1160+ if (ferror (fp ))
1161+ elog (ERROR , "Failed to read from file: \"%s\"" , map_path );
1162+
11571163 fio_close_stream (fp );
11581164}
11591165
@@ -1529,6 +1535,9 @@ dir_read_file_list(const char *root, const char *external_prefix,
15291535 parray_append (files , file );
15301536 }
15311537
1538+ if (ferror (fp ))
1539+ elog (ERROR , "Failed to read from file: \"%s\"" , file_txt );
1540+
15321541 fio_close_stream (fp );
15331542 return files ;
15341543}
@@ -1775,6 +1784,9 @@ read_database_map(pgBackup *backup)
17751784 parray_append (database_map , db_entry );
17761785 }
17771786
1787+ if (ferror (fp ))
1788+ elog (ERROR , "Failed to read from file: \"%s\"" , database_map_path );
1789+
17781790 fio_close_stream (fp );
17791791
17801792 /* Return NULL if file is empty */
0 commit comments