1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-12 11:45:24 +02:00

Fix fio_closedir

This commit is contained in:
Konstantin Knizhnik 2019-02-17 19:40:26 +03:00
parent 00c3bed898
commit a552e6a3d3
2 changed files with 4 additions and 3 deletions

View File

@ -1116,13 +1116,13 @@ read_tablespace_map(parray *files, const char *backup_dir)
join_path_components(map_path, db_path, PG_TABLESPACE_MAP_FILE);
/* Exit if database/tablespace_map doesn't exist */
if (!fileExists(map_path, FIO_DB_HOST))
if (!fileExists(map_path, FIO_BACKUP_HOST))
{
elog(LOG, "there is no file tablespace_map");
return;
}
fp = fio_open_stream(map_path, FIO_DB_HOST);
fp = fio_open_stream(map_path, FIO_BACKUP_HOST);
if (fp == NULL)
elog(ERROR, "cannot open \"%s\": %s", map_path, strerror(errno));

View File

@ -208,6 +208,7 @@ int fio_closedir(DIR *dir)
hdr.cop = FIO_CLOSEDIR;
hdr.handle = (size_t)dir - 1;
hdr.size = 0;
fio_fdset &= ~(1 << hdr.handle);
IO_CHECK(fio_write_all(fio_stdout, &hdr, sizeof(hdr)), sizeof(hdr));
return 0;
@ -397,7 +398,7 @@ int fio_pread(FILE* f, void* buf, off_t offs)
hdr.cop = FIO_PREAD;
hdr.handle = fd & ~FIO_PIPE_MARKER;
hdr.size = sizeof(XLogRecPtr);
hdr.size = 0;
hdr.arg = offs;
IO_CHECK(fio_write_all(fio_stdout, &hdr, sizeof(hdr)), sizeof(hdr));