52 pg_fatal(
"target file path is unsafe for open: \"%s\"", path);
70 pg_fatal(
"could not open target file \"%s\": %m",
84 pg_fatal(
"could not close target file \"%s\": %m",
104 pg_fatal(
"could not seek in target file \"%s\": %m",
120 pg_fatal(
"could not write file \"%s\": %m",
153 pg_fatal(
"undefined file type for \"%s\"", entry->
path);
176 pg_fatal(
"invalid action (CREATE) for regular file");
180 pg_fatal(
"undefined file type for \"%s\"", entry->
path);
195 pg_fatal(
"target file path is unsafe for removal: \"%s\"", path);
206 pg_fatal(
"could not remove file \"%s\": %m",
218 pg_fatal(
"target file path is unsafe for truncation: \"%s\"", path);
227 pg_fatal(
"could not open file \"%s\" for truncation: %m",
231 pg_fatal(
"could not truncate file \"%s\" to %u: %m",
243 pg_fatal(
"target directory path is unsafe for directory creation: \"%s\"",
251 pg_fatal(
"could not create directory \"%s\": %m",
261 pg_fatal(
"target directory path is unsafe for directory removal: \"%s\"",
269 pg_fatal(
"could not remove directory \"%s\": %m",
279 pg_fatal(
"target symlink path is unsafe for creation: \"%s\"", path);
286 pg_fatal(
"could not create symbolic link at \"%s\": %m",
296 pg_fatal(
"target symlink path is unsafe for removal: \"%s\"", path);
303 pg_fatal(
"could not remove symbolic link \"%s\": %m",
349 pg_fatal(
"could not open file \"%s\" for reading: %m",
353 pg_fatal(
"could not stat file \"%s\": %m",
364 pg_fatal(
"could not read file \"%s\": %m",
367 pg_fatal(
"could not read file \"%s\": read %d of %zu",
411 pg_fatal(
"could not open directory \"%s\": %m",
440 pg_fatal(
"could not stat file \"%s\": %m",
464 pg_fatal(
"could not read symbolic link \"%s\": %m",
467 pg_fatal(
"symbolic link \"%s\" target is too long",
479 strcmp(path,
"pg_wal") == 0)
485 pg_fatal(
"could not read directory \"%s\": %m",
489 pg_fatal(
"could not close directory \"%s\": %m",
#define Assert(condition)
struct dirent * readdir(DIR *)
DIR * opendir(const char *)
void * pg_malloc(size_t size)
void remove_target_file(const char *path, bool missing_ok)
static char dstpath[MAXPGPATH]
void traverse_datadir(const char *datadir, process_file_callback_t callback)
static void remove_target_dir(const char *path)
char * slurpFile(const char *datadir, const char *path, size_t *filesize)
void close_target_file(void)
static void create_target_symlink(const char *path, const char *link)
void truncate_target_file(const char *path, off_t newsize)
void remove_target(file_entry_t *entry)
void sync_target_dir(void)
void create_target(file_entry_t *entry)
void open_target_file(const char *path, bool trunc)
static void create_target_dir(const char *path)
void write_target_range(char *buf, off_t begin, size_t size)
static void remove_target_symlink(const char *path)
static void recurse_dir(const char *datadir, const char *parentpath, process_file_callback_t callback)
void(* process_file_callback_t)(const char *path, file_type_t type, size_t size, const char *link_target)
static DataDirSyncMethod sync_method
static void progress_report(uint64 relations_total, uint64 relations_checked, uint64 relpages_total, uint64 relpages_checked, const char *datname, bool force, bool finished)
static PgChecksumMode mode
static char buf[DEFAULT_XLOG_SEG_SIZE]
bool path_is_safe_for_extraction(const char *path)
static int fd(const char *x, int i)
char * source_link_target
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)
#define symlink(oldpath, newpath)
#define readlink(path, buf, size)