diff options
author | Guillem Jover <guillem@debian.org> | 2013-12-17 23:07:42 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-01-15 05:50:28 +0100 |
commit | 1c2b693e0b9de39dd27e715ae538f87a93ad3adc (patch) | |
tree | 32c068531a83b2c8e72e0077024f582067c98f21 /src | |
parent | d6341c151bc3e585170d231af9ef7db4f606ef46 (diff) | |
download | dpkg-1c2b693e0b9de39dd27e715ae538f87a93ad3adc.tar.gz |
Rename return code variables from r to rc
Diffstat (limited to 'src')
-rw-r--r-- | src/archives.c | 26 | ||||
-rw-r--r-- | src/configure.c | 6 | ||||
-rw-r--r-- | src/enquiry.c | 10 | ||||
-rw-r--r-- | src/remove.c | 9 | ||||
-rw-r--r-- | src/script.c | 22 | ||||
-rw-r--r-- | src/unpack.c | 6 |
6 files changed, 41 insertions, 38 deletions
diff --git a/src/archives.c b/src/archives.c index dcbba008c..3a1714f84 100644 --- a/src/archives.c +++ b/src/archives.c @@ -673,7 +673,7 @@ void setupfnamevbs(const char *filename) { int secure_remove(const char *filename) { - int r, e; + int rc, e; if (!rmdir(filename)) { debug(dbg_eachfiledetail, "secure_remove '%s' rmdir OK", filename); @@ -687,11 +687,13 @@ secure_remove(const char *filename) errno= e; return -1; } - r = secure_unlink(filename); + rc = secure_unlink(filename); e = errno; debug(dbg_eachfiledetail, "secure_remove '%s' unlink %s", - filename, r ? strerror(e) : "OK"); - errno= e; return r; + filename, rc ? strerror(e) : "OK"); + errno = e; + + return rc; } struct fileinlist *addfiletolist(struct tarcontext *tc, @@ -1554,7 +1556,7 @@ archivefiles(const char *const *argv) log_message("startup archives %s", cipaction->olong); if (f_recursive) { - int pi[2], nfiles, c, i, r; + int pi[2], nfiles, c, i, rc; pid_t pid; FILE *pf; static struct varbuf findoutput; @@ -1601,9 +1603,9 @@ archivefiles(const char *const *argv) } if (ferror(pf)) ohshite(_("error reading find's pipe")); if (fclose(pf)) ohshite(_("error closing find's pipe")); - r = subproc_wait_check(pid, "find", PROCNOERR); - if (r != 0) - ohshit(_("find for --recursive returned unhandled error %i"),r); + rc = subproc_wait_check(pid, "find", PROCNOERR); + if (rc != 0) + ohshit(_("find for --recursive returned unhandled error %i"), rc); if (!nfiles) ohshit(_("searched, but found no packages (files matching *.deb)")); @@ -1694,7 +1696,7 @@ archivefiles(const char *const *argv) bool wanttoinstall(struct pkginfo *pkg) { - int r; + int rc; if (pkg->want != want_install && pkg->want != want_hold) { if (f_alsoselect) { @@ -1713,10 +1715,10 @@ wanttoinstall(struct pkginfo *pkg) if (pkg->status < stat_unpacked) return true; - r = dpkg_version_compare(&pkg->available.version, &pkg->installed.version); - if (r > 0) { + rc = dpkg_version_compare(&pkg->available.version, &pkg->installed.version); + if (rc > 0) { return true; - } else if (r == 0) { + } else if (rc == 0) { /* Same version fully installed. */ if (f_skipsame) { notice(_("version %.250s of %.250s already installed, skipping"), diff --git a/src/configure.c b/src/configure.c index e3463e640..cc6caab68 100644 --- a/src/configure.c +++ b/src/configure.c @@ -371,13 +371,13 @@ deferred_configure_conffile(struct pkginfo *pkg, struct conffile *conff) struct stat stab; struct varbuf cdr = VARBUF_INIT, cdr2 = VARBUF_INIT; char *cdr2rest; - int r; + int rc; usenode = namenodetouse(findnamenode(conff->name, fnn_nocopy), pkg, &pkg->installed); - r = conffderef(pkg, &cdr, usenode->name); - if (r == -1) { + rc = conffderef(pkg, &cdr, usenode->name); + if (rc == -1) { conff->hash = EMPTYHASHFLAG; return; } diff --git a/src/enquiry.c b/src/enquiry.c index 33963180c..1ac3eb250 100644 --- a/src/enquiry.c +++ b/src/enquiry.c @@ -609,7 +609,7 @@ cmpversions(const char *const *argv) const struct relationinfo *rip; struct dpkg_version a, b; struct dpkg_error err; - int r; + int rc; if (!argv[0] || !argv[1] || !argv[2] || argv[3]) badusage(_("--compare-versions takes three arguments:" @@ -649,14 +649,14 @@ cmpversions(const char *const *argv) } else if (!dpkg_version_is_informative(&b)) { return rip->if_none_b; } - r = dpkg_version_compare(&a, &b); + rc = dpkg_version_compare(&a, &b); debug(dbg_general, "cmpversions a='%s' b='%s' r=%d", versiondescribe(&a,vdew_always), versiondescribe(&b,vdew_always), - r); - if (r > 0) + rc); + if (rc > 0) return rip->if_greater; - else if (r < 0) + else if (rc < 0) return rip->if_lesser; else return rip->if_equal; diff --git a/src/remove.c b/src/remove.c index 8a0d033e3..18c93dd18 100644 --- a/src/remove.c +++ b/src/remove.c @@ -456,7 +456,7 @@ static void removal_bulk_remove_leftover_dirs(struct pkginfo *pkg) { static void removal_bulk_remove_configfiles(struct pkginfo *pkg) { static const char *const removeconffexts[] = { REMOVECONFFEXTS, NULL }; - int r, removevbbase; + int rc, removevbbase; int conffnameused, conffbasenamelen; char *conffbasename; struct conffile *conff, **lconffp; @@ -514,10 +514,11 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) { conff->name); } varbuf_reset(&fnvb); - r= conffderef(pkg, &fnvb, conff->name); + rc = conffderef(pkg, &fnvb, conff->name); debug(dbg_conffdetail, "removal_bulk conffile '%s' (= '%s')", - conff->name, r == -1 ? "<r==-1>" : fnvb.buf); - if (r == -1) continue; + conff->name, rc == -1 ? "<rc == -1>" : fnvb.buf); + if (rc == -1) + continue; conffnameused = fnvb.used; if (unlink(fnvb.buf) && errno != ENOENT && errno != ENOTDIR) ohshite(_("cannot remove old config file `%.250s' (= `%.250s')"), diff --git a/src/script.c b/src/script.c index 49e640336..c0298d325 100644 --- a/src/script.c +++ b/src/script.c @@ -198,7 +198,7 @@ maintscript_exec(struct pkginfo *pkg, struct pkgbin *pkgbin, struct command *cmd, struct stat *stab, int warn) { pid_t pid; - int r; + int rc; setexecute(cmd->filename, stab); @@ -226,12 +226,12 @@ maintscript_exec(struct pkginfo *pkg, struct pkgbin *pkgbin, command_exec(cmd); } subproc_signals_setup(cmd->name); /* This does a push_cleanup(). */ - r = subproc_wait_check(pid, cmd->name, warn); + rc = subproc_wait_check(pid, cmd->name, warn); pop_cleanup(ehflag_normaltidy); pop_cleanup(ehflag_normaltidy); - return r; + return rc; } static int @@ -276,32 +276,32 @@ maintscript_installed(struct pkginfo *pkg, const char *scriptname, const char *desc, ...) { va_list args; - int r; + int rc; va_start(args, desc); - r = vmaintscript_installed(pkg, scriptname, desc, args); + rc = vmaintscript_installed(pkg, scriptname, desc, args); va_end(args); - if (r) + if (rc) post_script_tasks(); - return r; + return rc; } int maintscript_postinst(struct pkginfo *pkg, ...) { va_list args; - int r; + int rc; va_start(args, pkg); - r = vmaintscript_installed(pkg, POSTINSTFILE, "post-installation", args); + rc = vmaintscript_installed(pkg, POSTINSTFILE, "post-installation", args); va_end(args); - if (r) + if (rc) ensure_diversions(); - return r; + return rc; } int diff --git a/src/unpack.c b/src/unpack.c index 66b872fff..eb9d5fd1a 100644 --- a/src/unpack.c +++ b/src/unpack.c @@ -417,7 +417,7 @@ void process_archive(const char *filename) { struct dpkg_error err; enum parsedbflags parsedb_flags; - int r; + int rc; pid_t pid; struct pkgiterator *it; struct pkginfo *pkg, *otherpkg; @@ -934,8 +934,8 @@ void process_archive(const char *filename) { tc.backendpipe= p1[0]; tc.pkgset_getting_in_sync = pkgset_getting_in_sync(pkg); - r = tar_extractor(&tc, &tf); - if (r) { + rc = tar_extractor(&tc, &tf); + if (rc) { if (errno) { ohshite(_("error reading dpkg-deb tar output")); } else { |