-
Notifications
You must be signed in to change notification settings - Fork 86
rework file stat handling to simplify and cross-platform-ability #570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PIO_KIND_FIFO = 4, | ||
PIO_KIND_SOCK = 5, | ||
PIO_KIND_CHARDEV = 6, | ||
PIO_KIND_BLOCKDEV = 7, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
запятая в последнем элементе enum - это C99? документация postgres говорит - "at least C89-compliant".
src/archive.c
Outdated
@@ -388,7 +388,7 @@ push_file_internal(const char *wal_file_name, const char *pg_xlog_dir, | |||
char to_fullpath[MAXPGPATH]; | |||
char to_fullpath_part[MAXPGPATH]; | |||
/* partial handling */ | |||
struct stat st; | |||
pio_stat_t st; | |||
int partial_try_count = 0; | |||
ssize_t partial_file_size = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
partial_file_size тоже должен стать беззнаковым
@@ -55,6 +55,7 @@ pgBackupValidate(pgBackup *backup, pgRestoreParams *params) | |||
pthread_t *threads; | |||
validate_files_arg *threads_args; | |||
int i; | |||
err_i err; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нужно ли сюда FOBJ_FUNC_ARP или того, который в main достаточно?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В принципе, достаточно, т.к. если будет ошибка, то мы вывалимся.
…ability - don't use full `struct stat` since it differs between platforms - store file kind separately from mode in pb specific way - add pioFilesAreSame as replacement of fio_is_same_file since it needs st_ino and st_dev, therefore had to run on localdrive always.
74367e6
to
0e24b62
Compare
struct stat
since it differs between platforms