The gzclose() function shall close the compressed file stream file. If file was open for writing, gzclose() shall first flush any pending output. Any state information allocated shall be freed.
On success, gzclose() shall return Z_OK. Otherwise, gzclose() shall return an error value as described below.
On error, gzclose() may set
the global variable
to indicate the error.
The gzclose() shall return a value other than
or did not refer to an open compressed file stream.
An error occurred in the underlying base libraries, and the application should check
errno for further information.
no compression progress is possible during buffer flush (see deflate()).