summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_install/add/perform.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index dc7c430..2d80f85 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.49 1998/02/16 17:16:14 jkh Exp $";
+ "$Id: perform.c,v 1.50 1998/07/17 14:56:31 eivind Exp $";
#endif
/*
@@ -126,8 +126,11 @@ pkg_do(char *pkg)
}
Home = make_playpen(playpen, sb.st_size * 4);
if (!Home)
- warnx("unable to make playpen for %d bytes", sb.st_size * 4);
+ errx(1, "unable to make playpen for %d bytes", sb.st_size * 4);
where_to = Home;
+ /* Since we can call ourselves recursively, keep notes on where we came from */
+ if (!getenv("_TOP"))
+ setenv("_TOP", Home, 1);
if (unpack(pkg_fullname, extract)) {
warnx(
"unable to extract table of contents file from `%s' - not a package?",
@@ -240,7 +243,7 @@ pkg_do(char *pkg)
if (!Fake) {
if (!isURL(pkg) && !getenv("PKG_ADD_BASE")) {
- snprintf(path, FILENAME_MAX, "%s/%s.tgz", Home, p->name);
+ snprintf(path, FILENAME_MAX, "%s/%s.tgz", getenv("_TOP"), p->name);
if (fexists(path))
cp = path;
else
OpenPOWER on IntegriCloud