diff options
author | jkh <jkh@FreeBSD.org> | 1993-09-05 04:54:24 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1993-09-05 04:54:24 +0000 |
commit | e9a6985275ef309d1f9f603df83efd30018f94f8 (patch) | |
tree | 5237df764835d2c29873982e973a10aa873c31b3 /usr.sbin/pkg_install/lib/pen.c | |
parent | 443968adfa831a25c1830da2ba42acd56b84322f (diff) | |
download | FreeBSD-src-e9a6985275ef309d1f9f603df83efd30018f94f8.zip FreeBSD-src-e9a6985275ef309d1f9f603df83efd30018f94f8.tar.gz |
Made staging area configurable rather than assuming /tmp (-t)
Diffstat (limited to 'usr.sbin/pkg_install/lib/pen.c')
-rw-r--r-- | usr.sbin/pkg_install/lib/pen.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/lib/pen.c b/usr.sbin/pkg_install/lib/pen.c index c5eee71..1872d82 100644 --- a/usr.sbin/pkg_install/lib/pen.c +++ b/usr.sbin/pkg_install/lib/pen.c @@ -34,11 +34,13 @@ static char Pen[FILENAME_MAX]; * pathname of previous working directory. */ char * -make_playpen(void) +make_playpen(char *pen) { + if (!pen) + pen = "/tmp/instmp.XXXXXX"; if (!getcwd(Cwd, FILENAME_MAX)) upchuck("getcwd"); - strcpy(Pen, "/tmp/instmp.XXXXXX"); + strcpy(Pen, pen); if (!mktemp(Pen)) barf("Can't mktemp '%s'.", Pen); if (mkdir(Pen, 0755) == FAIL) @@ -61,3 +63,12 @@ leave_playpen(void) } } +/* Accessor function for telling us where the pen is */ +char * +where_playpen(void) +{ + if (Cwd[0]) + return Pen; + else + return NULL; +} |