Merge pull request #3512 from lparkes/fstapi

Failure to read FST files on *BSD systems
This commit is contained in:
Miodrag Milanović 2022-10-24 11:39:06 +02:00 committed by GitHub
commit c0e4d01aa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -3607,6 +3607,7 @@ static int fstReaderRecreateHierFile(struct fstReaderContext *xc)
fflush(xc->f);
#endif
zfd = dup(fileno(xc->f));
lseek(zfd, ftell(xc->f), SEEK_SET);
zhandle = gzdopen(zfd, "rb");
if (!zhandle) {
close(zfd);
@ -4272,6 +4273,7 @@ int fstReaderInit(struct fstReaderContext *xc)
#endif
zfd = dup(fileno(xc->f));
lseek(zfd, ftell(xc->f), SEEK_SET);
zhandle = gzdopen(zfd, "rb");
if (zhandle) {
for (offpnt = 0; offpnt < uclen; offpnt += FST_GZIO_LEN) {