diff options
Diffstat (limited to 'lib/libz/zopen.c')
-rw-r--r-- | lib/libz/zopen.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/libz/zopen.c b/lib/libz/zopen.c index 822a5e1..cde022d 100644 --- a/lib/libz/zopen.c +++ b/lib/libz/zopen.c @@ -3,7 +3,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/lib/libz/zopen.c 84228 2001-09-30 22:39:00Z dillon $"); +__FBSDID("$FreeBSD$"); #include <stdio.h> #include <zlib.h> @@ -29,6 +29,12 @@ xgzclose(void *cookie) return gzclose(cookie); } +static fpos_t +xgzseek(void *cookie, fpos_t offset, int whence) +{ + return gzseek(cookie, (z_off_t)offset, whence); +} + FILE * zopen(const char *fname, const char *mode) { @@ -37,7 +43,7 @@ zopen(const char *fname, const char *mode) return NULL; if(*mode == 'r') - return (funopen(gz, xgzread, NULL, NULL, xgzclose)); + return (funopen(gz, xgzread, NULL, xgzseek, xgzclose)); else - return (funopen(gz, NULL, xgzwrite, NULL, xgzclose)); + return (funopen(gz, NULL, xgzwrite, xgzseek, xgzclose)); } |