]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
libkmod/zlib: s/err/ret/ for consistency
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Sat, 30 Nov 2024 16:22:26 +0000 (10:22 -0600)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 6 Dec 2024 21:06:02 +0000 (13:06 -0800)
Use the libkmod-file-xz.c as reference, keeping similar variable names
so it's easy to share code.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/262
libkmod/libkmod-file-zlib.c

index 478a8c80409c88e6f55391ff21c606ca91a26f9e..a7e27b80b89e410101ddf67ef936109b25e218ba 100644 (file)
@@ -23,7 +23,7 @@
 int kmod_file_load_zlib(struct kmod_file *file)
 {
        _cleanup_free_ unsigned char *p = NULL;
-       int err = 0;
+       int ret = 0;
        off_t did = 0, total = 0;
        gzFile gzf;
        int gzfd;
@@ -45,7 +45,7 @@ int kmod_file_load_zlib(struct kmod_file *file)
                if (did == total) {
                        void *tmp = realloc(p, total + READ_STEP);
                        if (tmp == NULL) {
-                               err = -errno;
+                               ret = -errno;
                                goto error;
                        }
                        total += READ_STEP;
@@ -62,7 +62,7 @@ int kmod_file_load_zlib(struct kmod_file *file)
                        ERR(file->ctx, "gzip: %s\n", gz_errmsg);
 
                        /* gzip might not set errno here */
-                       err = gzerr == Z_ERRNO ? -errno : -EINVAL;
+                       ret = gzerr == Z_ERRNO ? -errno : -EINVAL;
                        goto error;
                }
                did += r;
@@ -76,5 +76,5 @@ int kmod_file_load_zlib(struct kmod_file *file)
 
 error:
        gzclose(gzf); /* closes the gzfd */
-       return err;
+       return ret;
 }