summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/lib/pen.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-08-26 18:36:27 +0000
committerjkh <jkh@FreeBSD.org>1995-08-26 18:36:27 +0000
commit3af739a3a9ac4943f02931c742fa67c6102c081a (patch)
treea521a600b16780a6cc0acdc8c8b21350c5b72413 /usr.sbin/pkg_install/lib/pen.c
parent22605bdc302e271da16da58bf7daa59720d3c8fd (diff)
downloadFreeBSD-src-3af739a3a9ac4943f02931c742fa67c6102c081a.zip
FreeBSD-src-3af739a3a9ac4943f02931c742fa67c6102c081a.tar.gz
Make the play-pen searching routine even more agile in trying
to create a /usr/tmp dir if it makes sense to do so.
Diffstat (limited to 'usr.sbin/pkg_install/lib/pen.c')
-rw-r--r--usr.sbin/pkg_install/lib/pen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/pkg_install/lib/pen.c b/usr.sbin/pkg_install/lib/pen.c
index b084cad..2de4ee3 100644
--- a/usr.sbin/pkg_install/lib/pen.c
+++ b/usr.sbin/pkg_install/lib/pen.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: pen.c,v 1.15 1995/08/17 00:36:06 jkh Exp $";
+static const char *rcsid = "$Id: pen.c,v 1.16 1995/08/26 10:15:18 jkh Exp $";
#endif
/*
@@ -47,6 +47,8 @@ find_play_pen(size_t sz)
strcpy(Pen, "/var/tmp/instmp.XXXXXX");
else if (stat("/tmp", &sb) != FAIL && min_free("/tmp") >= sz)
strcpy(Pen, "/tmp/instmp.XXXXXX");
+ else if ((stat("/usr/tmp", &sb) == SUCCESS | mkdir("/usr/tmp", 01777) == SUCCESS) && min_free("/usr/tmp") >= sz)
+ strcpy(Pen, "/usr/tmp/instmp.XXXXXX");
else barf("Can't find enough temporary space to extract the files, please set\nyour PKG_TMPDIR environment variable to a location with at least %d bytes\nfree.", sz);
return Pen;
}
OpenPOWER on IntegriCloud