This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=dca905e326a810286caab5ab8bc1dd2f511114d8

commit dca905e326a810286caab5ab8bc1dd2f511114d8
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Feb 6 03:09:31 2024 +0100

    dpkg: Rename r variable for readlink() return value to linksize
    
    This uses the same variable name as other instances in the codebase.
    
    Changelog: internal
---
 src/main/configure.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/main/configure.c b/src/main/configure.c
index c2d58c768..76998dc98 100644
--- a/src/main/configure.c
+++ b/src/main/configure.c
@@ -724,6 +724,8 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, 
const char *in)
                              in, result->buf);
                        return 0;
                } else if (S_ISLNK(stab.st_mode)) {
+                       ssize_t linksize;
+
                        debug(dbg_conffdetail, "conffderef symlink 
loopprotect=%d",
                              loopprotect);
                        if (loopprotect++ >= 25) {
@@ -736,28 +738,29 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, 
const char *in)
 
                        varbuf_reset(&target);
                        varbuf_grow(&target, stab.st_size + 1);
-                       r = readlink(result->buf, target.buf, target.size);
-                       if (r < 0) {
+                       linksize = readlink(result->buf, target.buf, 
target.size);
+                       if (linksize < 0) {
                                warning(_("%s: unable to readlink conffile 
'%s'\n"
                                          " (= '%s'): %s"),
                                        pkg_name(pkg, pnaw_nonambig), in,
                                        result->buf, strerror(errno));
                                return -1;
-                       } else if (r != stab.st_size) {
+                       } else if (linksize != stab.st_size) {
                                warning(_("symbolic link '%.250s' size has "
                                          "changed from %jd to %zd"),
-                                       result->buf, (intmax_t)stab.st_size, r);
+                                       result->buf, (intmax_t)stab.st_size,
+                                       linksize);
                                /* If the returned size is smaller, let's
                                 * proceed, otherwise error out. */
-                               if (r > stab.st_size)
+                               if (linksize > stab.st_size)
                                        return -1;
                        }
-                       varbuf_trunc(&target, r);
+                       varbuf_trunc(&target, linksize);
                        varbuf_end_str(&target);
 
                        debug(dbg_conffdetail,
                              "conffderef readlink gave %zd, '%s'",
-                             r, target.buf);
+                             linksize, target.buf);
 
                        if (target.buf[0] == '/') {
                                varbuf_set_str(result, dpkg_fsys_get_dir());

-- 
Dpkg.Org's dpkg

Reply via email to