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
An error occurred in the underlying base libraries, and the application should check
no compression progress is possible during buffer flush (see deflate()).