diff options
author | sobomax <sobomax@FreeBSD.org> | 2001-08-02 13:13:06 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2001-08-02 13:13:06 +0000 |
commit | 77d54406d5ea20673161903b635c712d3013fb9f (patch) | |
tree | 85001974baefbf2b2c1f82bce9cfd587b562449e /usr.sbin/pkg_install/delete | |
parent | 404c0eeec630aa6acda2649e65a4305535b2543b (diff) | |
download | FreeBSD-src-77d54406d5ea20673161903b635c712d3013fb9f.zip FreeBSD-src-77d54406d5ea20673161903b635c712d3013fb9f.tar.gz |
Cosmetics: replace dozen instances of "(tmp = getenv(PKG_DBDIR) ? tmp : DEF_LOG_DIR)"
with macro.
MFC after: 1 month
Diffstat (limited to 'usr.sbin/pkg_install/delete')
-rw-r--r-- | usr.sbin/pkg_install/delete/main.c | 2 | ||||
-rw-r--r-- | usr.sbin/pkg_install/delete/perform.c | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/usr.sbin/pkg_install/delete/main.c b/usr.sbin/pkg_install/delete/main.c index f87af3d..2dba240 100644 --- a/usr.sbin/pkg_install/delete/main.c +++ b/usr.sbin/pkg_install/delete/main.c @@ -127,7 +127,7 @@ main(int argc, char **argv) if (pkgs == start && MatchType != MATCH_ALL) warnx("missing package name(s)"), usage(); *pkgs = NULL; - tmp = getenv(PKG_DBDIR) ? getenv(PKG_DBDIR) : DEF_LOG_DIR; + tmp = LOG_DIR; (void) stat(tmp, &stat_s); if (!Fake && getuid() && geteuid() != stat_s.st_uid) { if (!Force) diff --git a/usr.sbin/pkg_install/delete/perform.c b/usr.sbin/pkg_install/delete/perform.c index 4469299..21815f6 100644 --- a/usr.sbin/pkg_install/delete/perform.c +++ b/usr.sbin/pkg_install/delete/perform.c @@ -97,8 +97,7 @@ pkg_do(char *pkg) if (Plist.head) free_plist(&Plist); - sprintf(LogDir, "%s/%s", (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR, - pkg); + sprintf(LogDir, "%s/%s", LOG_DIR, pkg); if (!fexists(LogDir)) { warnx("no such package '%s' installed", pkg); @@ -290,9 +289,7 @@ undepend(PackingList p, char *pkgname) char *tmp; int s; - sprintf(fname, "%s/%s/%s", - (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR, - p->name, REQUIRED_BY_FNAME); + sprintf(fname, "%s/%s/%s", LOG_DIR, p->name, REQUIRED_BY_FNAME); fp = fopen(fname, "r"); if (fp == NULL) { warnx("couldn't open dependency file '%s'", fname); |