diff options
author | sobomax <sobomax@FreeBSD.org> | 2001-10-11 11:29:12 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2001-10-11 11:29:12 +0000 |
commit | 658cbab38fd31894a76a6a4524639adaf60f845d (patch) | |
tree | afa5014696268de9294f860d530717b02c335e9c /usr.sbin/pkg_install/lib/pen.c | |
parent | aaf46285fe7732b38f28d2d802792b3e44399da2 (diff) | |
download | FreeBSD-src-658cbab38fd31894a76a6a4524639adaf60f845d.zip FreeBSD-src-658cbab38fd31894a76a6a4524639adaf60f845d.tar.gz |
Make `-t' flag in pkg_*(1) tools actually working.
PR: 30843
Submitted by: Vladimir B. Grebenschikov <vova@express.ru>
MFC after: 2 weeks
Diffstat (limited to 'usr.sbin/pkg_install/lib/pen.c')
-rw-r--r-- | usr.sbin/pkg_install/lib/pen.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/pkg_install/lib/pen.c b/usr.sbin/pkg_install/lib/pen.c index f80763c..322067d 100644 --- a/usr.sbin/pkg_install/lib/pen.c +++ b/usr.sbin/pkg_install/lib/pen.c @@ -25,6 +25,7 @@ static const char rcsid[] = #include "lib.h" #include <err.h> +#include <libgen.h> #include <sys/signal.h> #include <sys/param.h> #include <sys/mount.h> @@ -46,7 +47,7 @@ find_play_pen(char *pen, off_t sz) char *cp; struct stat sb; - if (pen[0] && stat(pen, &sb) != FAIL && (min_free(pen) >= sz)) + if (pen[0] && !fexists(pen) == FAIL && (min_free(dirname(pen)) >= sz)) return pen; else if ((cp = getenv("PKG_TMPDIR")) != NULL && stat(cp, &sb) != FAIL && (min_free(cp) >= sz)) sprintf(pen, "%s/instmp.XXXXXX", cp); |