[Zlib-devel] zlib 1.2.4 released!

John Bowler jbowler at frontiernet.net
Thu Mar 18 20:38:20 EDT 2010


Well... in 1.2.3 MACOS, RISCOS (__riscos__?), _BEOS_ and _WIN32_WCE all had gzdopen implementations that failed by virtue of the (obscure) fact that zutil.h #defines fdopen(fd,mode) as NULL.  In 1.2.4 that collection of #defines is still there in zutil.h, but the GZ code no longer calls fdopen (nothing does), so, in fact, I believe WindowsCE will have a magically working gzdopen(), assuming the code compiles.

Has anyone tested on RISCOS?  I'd expect it not to even compile now because of missing functions like open(), read(), write() and lseek().

From: William A. Rowe Jr. [mailto:wrowe at rowe-clan.net] 
>Just to clarify; the lib does not close a gzdopen()'ed file?  Or does it?
>If so some DuplicateHandle/crt close() magic might also be required on that #define
>stub.

gzclose(gzFile) calls close(state->fd), and this is expected (as zlib.h documents it), so the whole thing gets a lot more complicated, particularly given the comments in zlib.h about what happens if the gzdopen fails.

Maybe it is better to have gznativeopen(HFILE, char*) and have that *not* close the HFILE ever, on the basis that only the creator of an object should ever destroy it, or is this getting too complicated...

John Bowler <jbowler at acm.org>





More information about the Zlib-devel mailing list