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:
parent
00c3bed898
commit
a552e6a3d3
@ -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));
|
||||
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user