--- a/zlib.h 2010-01-18 18:01:57.000000000 +0200 +++ b/zlib.h 2010-01-18 18:01:02.000000000 +0200 @@ -1187,10 +1187,13 @@ The next call of gzclose on the returned gzFile will also close the file descriptor fd, just like fclose(fdopen(fd), mode) closes the file descriptor - fd. If you want to keep fd open, use gzdopen(dup(fd), mode). + fd. If you want to keep fd open, use gzdopen(dupfd=dup(fd), mode). gzdopen returns NULL if there was insufficient memory to allocate the - (de)compression state. + (de)compression state, an invalid mode was specified, there was a zlib + version mismatch, or if fdopen fails. In either of these cases it is the + responsibility of the caller to close the file descriptor, since gzdopen + leaves it open, and gzclose can't close it. */ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));