diff options
-rw-r--r-- | dselect/pkgdepcon.cc | 32 | ||||
-rw-r--r-- | dselect/pkglist.cc | 6 | ||||
-rw-r--r-- | lib/dpkg/version.c | 22 | ||||
-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 | ||||
-rw-r--r-- | utils/start-stop-daemon.c | 6 | ||||
-rw-r--r-- | utils/update-alternatives.c | 8 |
11 files changed, 81 insertions, 72 deletions
diff --git a/dselect/pkgdepcon.cc b/dselect/pkgdepcon.cc index 1d1874f84..d49cab828 100644 --- a/dselect/pkgdepcon.cc +++ b/dselect/pkgdepcon.cc @@ -215,7 +215,7 @@ int packagelist::resolvedepcon(dependency *depends) { perpackagestate *best, *fixbyupgrade; deppossi *possi, *provider; bool foundany; - int r; + int rc; if (debug_has_flag(dbg_depcon)) { varbuf pkg_names; @@ -262,13 +262,13 @@ int packagelist::resolvedepcon(dependency *depends) { switch (depends->type) { case dep_enhances: case dep_suggests: - r= add(depends, dp_may); - return r; + rc = add(depends, dp_may); + return rc; case dep_recommends: - r= add(depends, dp_should); + rc = add(depends, dp_should); break; default: - r= add(depends, dp_must); + rc = add(depends, dp_must); } if (fixbyupgrade) { @@ -300,20 +300,21 @@ int packagelist::resolvedepcon(dependency *depends) { debug(dbg_depcon, "packagelist[%p]::resolvedepcon([%p]): mustdeselect nobest", this, depends); - return r; + return rc; } } debug(dbg_depcon, "packagelist[%p]::resolvedepcon([%p]): select best=%s{%d}", this, depends, pkg_name(best->pkg, pnaw_always), best->spriority); - if (best->spriority >= sp_selecting) return r; + if (best->spriority >= sp_selecting) + return rc; /* Always select depends. Only select recommends if we got here because * of a manually-initiated install request. */ if (depends->type != dep_recommends || manual_install) { best->selected= best->suggested= pkginfo::want_install; best->spriority= sp_selecting; } - return r ? 2 : 0; + return rc ? 2 : 0; mustdeselect: best= depends->up->clientdata; @@ -321,7 +322,8 @@ int packagelist::resolvedepcon(dependency *depends) { "packagelist[%p]::resolvedepcon([%p]): mustdeselect best=%s{%d}", this, depends, pkg_name(best->pkg, pnaw_always), best->spriority); - if (best->spriority >= sp_deselecting) return r; + if (best->spriority >= sp_deselecting) + return rc; /* Always remove depends, but never remove recommends. */ if (depends->type != dep_recommends) { best->selected= best->suggested= @@ -329,7 +331,7 @@ int packagelist::resolvedepcon(dependency *depends) { ? pkginfo::want_purge : pkginfo::want_deinstall; // FIXME: configurable best->spriority= sp_deselecting; } - return r ? 2 : 0; + return rc ? 2 : 0; case dep_conflicts: case dep_breaks: @@ -351,16 +353,18 @@ int packagelist::resolvedepcon(dependency *depends) { this, depends); if (depends->up->set != depends->list->ed) { - r = deselect_one_of(depends->up, &depends->list->ed->pkg, depends); - if (r) - return r; + rc = deselect_one_of(depends->up, &depends->list->ed->pkg, depends); + if (rc) + return rc; } for (provider = depends->list->ed->depended.available; provider; provider = provider->rev_next) { if (provider->up->type != dep_provides) continue; if (provider->up->up == depends->up) continue; // conflicts & provides same thing - r= deselect_one_of(depends->up, provider->up->up, depends); if (r) return r; + rc = deselect_one_of(depends->up, provider->up->up, depends); + if (rc) + return rc; } debug(dbg_depcon, "packagelist[%p]::resolvedepcon([%p]): no desel", this, depends); diff --git a/dselect/pkglist.cc b/dselect/pkglist.cc index 5ee0e7018..ccf835f4d 100644 --- a/dselect/pkglist.cc +++ b/dselect/pkglist.cc @@ -495,7 +495,7 @@ packagelist::~packagelist() { bool packagelist::checksearch(char *rx) { - int r,opt = REG_NOSUB; + int rc, opt = REG_NOSUB; int pos; if (str_is_unset(rx)) @@ -528,8 +528,8 @@ packagelist::checksearch(char *rx) } } - r = regcomp(&searchfsm, rx, opt); - if (r != 0) { + rc = regcomp(&searchfsm, rx, opt); + if (rc != 0) { displayerror(_("error in regular expression")); return false; } diff --git a/lib/dpkg/version.c b/lib/dpkg/version.c index e3ba2ddc9..22e485b66 100644 --- a/lib/dpkg/version.c +++ b/lib/dpkg/version.c @@ -139,16 +139,16 @@ int dpkg_version_compare(const struct dpkg_version *a, const struct dpkg_version *b) { - int r; + int rc; if (a->epoch > b->epoch) return 1; if (a->epoch < b->epoch) return -1; - r = verrevcmp(a->version, b->version); - if (r) - return r; + rc = verrevcmp(a->version, b->version); + if (rc) + return rc; return verrevcmp(a->revision, b->revision); } @@ -172,24 +172,24 @@ dpkg_version_relate(const struct dpkg_version *a, enum dpkg_relation rel, const struct dpkg_version *b) { - int r; + int rc; if (rel == dpkg_relation_none) return true; - r = dpkg_version_compare(a, b); + rc = dpkg_version_compare(a, b); switch (rel) { case dpkg_relation_eq: - return r == 0; + return rc == 0; case dpkg_relation_lt: - return r < 0; + return rc < 0; case dpkg_relation_le: - return r <= 0; + return rc <= 0; case dpkg_relation_gt: - return r > 0; + return rc > 0; case dpkg_relation_ge: - return r >= 0; + return rc >= 0; default: internerr("unknown dpkg_relation %d", rel); } 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 { diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index b15de6614..77a66e6ad 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -1709,7 +1709,7 @@ static bool do_stop_timeout(int timeout, int *n_killed, int *n_notkilled) { struct timeval stopat, before, after, interval, maxinterval; - int r, ratio; + int rc, ratio; xgettimeofday(&stopat); stopat.tv_sec += timeout; @@ -1745,8 +1745,8 @@ do_stop_timeout(int timeout, int *n_killed, int *n_notkilled) interval.tv_usec <= MIN_POLL_INTERVAL) interval.tv_usec = MIN_POLL_INTERVAL; - r = select(0, NULL, NULL, NULL, &interval); - if (r < 0 && errno != EINTR) + rc = select(0, NULL, NULL, NULL, &interval); + if (rc < 0 && errno != EINTR) fatal("select() failed for pause"); } } diff --git a/utils/update-alternatives.c b/utils/update-alternatives.c index 987a15161..201805979 100644 --- a/utils/update-alternatives.c +++ b/utils/update-alternatives.c @@ -466,10 +466,12 @@ rename_mv(const char *src, const char *dst) if (rename(src, dst) != 0) { const char *args[] = { "mv", src, dst, NULL }; - int r; - r = spawn("mv", args); - if (WIFEXITED(r) && WEXITSTATUS(r) == 0) + int rc; + + rc = spawn("mv", args); + if (WIFEXITED(rc) && WEXITSTATUS(rc) == 0) return true; + return false; } |