diff --git a/src/dir.c b/src/dir.c index 3cf3490c..43ae17b4 100644 --- a/src/dir.c +++ b/src/dir.c @@ -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)); diff --git a/src/utils/file.c b/src/utils/file.c index cd1b1d42..ec723252 100644 --- a/src/utils/file.c +++ b/src/utils/file.c @@ -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));