zlib: Fix race condition when closing gzip ports.
authorLudovic Courtès <ludo@gnu.org>
Sun, 19 Nov 2017 22:02:29 +0000 (23:02 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sun, 19 Nov 2017 22:09:01 +0000 (23:09 +0100)
commit85f4f7b79040d982c6a655c898b4cd00d868fa9c
tree4cc7fa226e57fed5f4269f0eb8e3d61af7d2c7a0
parent52d174d6d116d75c71ddf0aa448b05f58637e9df
zlib: Fix race condition when closing gzip ports.

Fixes <https://bugs.gnu.org/29335>.

* guix/zlib.scm (close-procedure): Remove.
(make-gzip-input-port): Do (dup (fileno port)) to get a file descriptor
for 'gzdopen'.  Close PORT before returning.  Use 'gzclose' as the
'close' procedure of the returned port.
(make-gzip-output-port): Likewise.
guix/zlib.scm