Skip to content

Commit

Permalink
libkmod/zlib: s/err/ret/ for consistency
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Link: #262
  • Loading branch information
lucasdemarchi committed Dec 6, 2024
1 parent fe58450 commit bb84dcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libkmod/libkmod-file-zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -76,5 +76,5 @@ int kmod_file_load_zlib(struct kmod_file *file)

error:
gzclose(gzf); /* closes the gzfd */
return err;
return ret;
}

0 comments on commit bb84dcf

Please sign in to comment.