]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: use a dup()'d fd for zlib
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 12 Feb 2024 17:23:02 +0000 (17:23 +0000)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 30 Apr 2024 17:33:52 +0000 (12:33 -0500)
commitd6cd6c74d2d225306cc50a8ca9cc03cf015c5c4b
tree78507faebd7cab9e1ac3c93589e48e846bac9c74
parentb0a78466d0d7442022f815a15f00e9b21fe7e455
libkmod: use a dup()'d fd for zlib

The gzdopen() API used, takes ownership of the fd. To make that more
explicit we clear it (-1) as applicable.

Yet again, kmod has explicit API to return the fd to the user - which
currently is used solely when uncompressed, so we're safe.

Regardless - simply duplicate the fd locally and use that with zlib.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
libkmod/libkmod-file.c