mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-02-01 13:27:47 +02:00
rename "omit_symlink" flag to follow_symlink
This commit is contained in:
parent
3b97c4f4cd
commit
57da2e5b38
20
src/dir.c
20
src/dir.c
@ -122,7 +122,7 @@ static int BlackListCompare(const void *str1, const void *str2);
|
||||
|
||||
static char dir_check_file(pgFile *file);
|
||||
static void dir_list_file_internal(parray *files, pgFile *parent, bool exclude,
|
||||
bool omit_symlink, parray *black_list,
|
||||
bool follow_symlink, parray *black_list,
|
||||
int external_dir_num, fio_location location);
|
||||
static void opt_path_map(ConfigOption *opt, const char *arg,
|
||||
TablespaceList *list, const char *type);
|
||||
@ -159,14 +159,14 @@ dir_create_dir(const char *dir, mode_t mode)
|
||||
}
|
||||
|
||||
pgFile *
|
||||
pgFileNew(const char *path, const char *rel_path, bool omit_symlink,
|
||||
pgFileNew(const char *path, const char *rel_path, bool follow_symlink,
|
||||
int external_dir_num, fio_location location)
|
||||
{
|
||||
struct stat st;
|
||||
pgFile *file;
|
||||
|
||||
/* stat the file */
|
||||
if (fio_stat(path, &st, omit_symlink, location) < 0)
|
||||
if (fio_stat(path, &st, follow_symlink, location) < 0)
|
||||
{
|
||||
/* file not found is not an error case */
|
||||
if (errno == ENOENT)
|
||||
@ -445,11 +445,11 @@ BlackListCompare(const void *str1, const void *str2)
|
||||
* List files, symbolic links and directories in the directory "root" and add
|
||||
* pgFile objects to "files". We add "root" to "files" if add_root is true.
|
||||
*
|
||||
* When omit_symlink is true, symbolic link is ignored and only file or
|
||||
* When follow_symlink is true, symbolic link is ignored and only file or
|
||||
* directory linked to will be listed.
|
||||
*/
|
||||
void
|
||||
dir_list_file(parray *files, const char *root, bool exclude, bool omit_symlink,
|
||||
dir_list_file(parray *files, const char *root, bool exclude, bool follow_symlink,
|
||||
bool add_root, int external_dir_num, fio_location location)
|
||||
{
|
||||
pgFile *file;
|
||||
@ -490,7 +490,7 @@ dir_list_file(parray *files, const char *root, bool exclude, bool omit_symlink,
|
||||
parray_qsort(black_list, BlackListCompare);
|
||||
}
|
||||
|
||||
file = pgFileNew(root, "", omit_symlink, external_dir_num, location);
|
||||
file = pgFileNew(root, "", follow_symlink, external_dir_num, location);
|
||||
if (file == NULL)
|
||||
{
|
||||
/* For external directory this is not ok */
|
||||
@ -512,7 +512,7 @@ dir_list_file(parray *files, const char *root, bool exclude, bool omit_symlink,
|
||||
if (add_root)
|
||||
parray_append(files, file);
|
||||
|
||||
dir_list_file_internal(files, file, exclude, omit_symlink, black_list,
|
||||
dir_list_file_internal(files, file, exclude, follow_symlink, black_list,
|
||||
external_dir_num, location);
|
||||
|
||||
if (!add_root)
|
||||
@ -731,7 +731,7 @@ dir_check_file(pgFile *file)
|
||||
*/
|
||||
static void
|
||||
dir_list_file_internal(parray *files, pgFile *parent, bool exclude,
|
||||
bool omit_symlink, parray *black_list,
|
||||
bool follow_symlink, parray *black_list,
|
||||
int external_dir_num, fio_location location)
|
||||
{
|
||||
DIR *dir;
|
||||
@ -764,7 +764,7 @@ dir_list_file_internal(parray *files, pgFile *parent, bool exclude,
|
||||
join_path_components(child, parent->path, dent->d_name);
|
||||
join_path_components(rel_child, parent->rel_path, dent->d_name);
|
||||
|
||||
file = pgFileNew(child, rel_child, omit_symlink, external_dir_num,
|
||||
file = pgFileNew(child, rel_child, follow_symlink, external_dir_num,
|
||||
location);
|
||||
if (file == NULL)
|
||||
continue;
|
||||
@ -821,7 +821,7 @@ dir_list_file_internal(parray *files, pgFile *parent, bool exclude,
|
||||
* recursively.
|
||||
*/
|
||||
if (S_ISDIR(file->mode))
|
||||
dir_list_file_internal(files, file, exclude, omit_symlink,
|
||||
dir_list_file_internal(files, file, exclude, follow_symlink,
|
||||
black_list, external_dir_num, location);
|
||||
}
|
||||
|
||||
|
@ -587,7 +587,7 @@ extern const char* deparse_compress_alg(int alg);
|
||||
|
||||
/* in dir.c */
|
||||
extern void dir_list_file(parray *files, const char *root, bool exclude,
|
||||
bool omit_symlink, bool add_root, int external_dir_num, fio_location location);
|
||||
bool follow_symlink, bool add_root, int external_dir_num, fio_location location);
|
||||
|
||||
extern void create_data_directories(parray *dest_files,
|
||||
const char *data_dir,
|
||||
@ -620,7 +620,7 @@ extern bool fileExists(const char *path, fio_location location);
|
||||
extern size_t pgFileSize(const char *path);
|
||||
|
||||
extern pgFile *pgFileNew(const char *path, const char *rel_path,
|
||||
bool omit_symlink, int external_dir_num,
|
||||
bool follow_symlink, int external_dir_num,
|
||||
fio_location location);
|
||||
extern pgFile *pgFileInit(const char *path, const char *rel_path);
|
||||
extern void pgFileDelete(pgFile *file);
|
||||
|
@ -663,7 +663,7 @@ int fio_fstat(int fd, struct stat* st)
|
||||
}
|
||||
|
||||
/* Get information about file */
|
||||
int fio_stat(char const* path, struct stat* st, bool follow_symlinks, fio_location location)
|
||||
int fio_stat(char const* path, struct stat* st, bool follow_symlink, fio_location location)
|
||||
{
|
||||
if (fio_is_remote(location))
|
||||
{
|
||||
@ -672,7 +672,7 @@ int fio_stat(char const* path, struct stat* st, bool follow_symlinks, fio_locati
|
||||
|
||||
hdr.cop = FIO_STAT;
|
||||
hdr.handle = -1;
|
||||
hdr.arg = follow_symlinks;
|
||||
hdr.arg = follow_symlink;
|
||||
hdr.size = path_len;
|
||||
|
||||
IO_CHECK(fio_write_all(fio_stdout, &hdr, sizeof(hdr)), sizeof(hdr));
|
||||
@ -691,7 +691,7 @@ int fio_stat(char const* path, struct stat* st, bool follow_symlinks, fio_locati
|
||||
}
|
||||
else
|
||||
{
|
||||
return follow_symlinks ? stat(path, st) : lstat(path, st);
|
||||
return follow_symlink ? stat(path, st) : lstat(path, st);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user