Document gzread() capability to read concurrently written files.
Also since gzread() will no longer return an error for an incomplete gzip file, have gzclose() return an error if the last gzread() ended in the middle of a gzip stream.
This commit is contained in:
5
gzread.c
5
gzread.c
@@ -553,7 +553,7 @@ int ZEXPORT gzdirect(file)
|
||||
int ZEXPORT gzclose_r(file)
|
||||
gzFile file;
|
||||
{
|
||||
int ret;
|
||||
int ret, err;
|
||||
gz_statep state;
|
||||
|
||||
/* get internal structure */
|
||||
@@ -571,9 +571,10 @@ int ZEXPORT gzclose_r(file)
|
||||
free(state->out);
|
||||
free(state->in);
|
||||
}
|
||||
err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK;
|
||||
gz_error(state, Z_OK, NULL);
|
||||
free(state->path);
|
||||
ret = close(state->fd);
|
||||
free(state);
|
||||
return ret ? Z_ERRNO : Z_OK;
|
||||
return ret ? Z_ERRNO : err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user