Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/pkg_install/lib Don't mkdir("/usr/tmp") in a desper...



details:   https://anonhg.NetBSD.org/src/rev/0c1fcd15cb76
branches:  trunk
changeset: 499655:0c1fcd15cb76
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Sun Nov 26 03:12:01 2000 +0000

description:
Don't mkdir("/usr/tmp") in a desperate try to get some space.
If it's there, use it. If it's not there - bad luck.

Pointed out by Simon Burge <simonb%wasabisystems.com@localhost>.

diffstat:

 usr.sbin/pkg_install/lib/pen.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r b9cee4d674e4 -r 0c1fcd15cb76 usr.sbin/pkg_install/lib/pen.c
--- a/usr.sbin/pkg_install/lib/pen.c    Sun Nov 26 02:50:12 2000 +0000
+++ b/usr.sbin/pkg_install/lib/pen.c    Sun Nov 26 03:12:01 2000 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: pen.c,v 1.17 2000/07/24 02:54:22 hubertf Exp $ */
+/*     $NetBSD: pen.c,v 1.18 2000/11/26 03:12:01 hubertf Exp $ */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: pen.c,v 1.25 1997/10/08 07:48:12 charnier Exp";
 #else
-__RCSID("$NetBSD: pen.c,v 1.17 2000/07/24 02:54:22 hubertf Exp $");
+__RCSID("$NetBSD: pen.c,v 1.18 2000/11/26 03:12:01 hubertf Exp $");
 #endif
 #endif
 
@@ -97,7 +97,7 @@
                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)
+       else if (stat("/usr/tmp", &sb) != FAIL && min_free("/usr/tmp") >= sz)
                strcpy(pen, "/usr/tmp/instmp.XXXXXX");
        else {
                cleanup(0);



Home | Main Index | Thread Index | Old Index