Use _PATH_TMP instead of a literal /tmp; noted by Christos

This commit is contained in:
dholland 2010-04-22 22:39:13 +00:00
parent bdb6986f24
commit d1466497fc
1 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.181 2010/04/22 20:25:16 dholland Exp $ */ /* $NetBSD: main.c,v 1.182 2010/04/22 22:39:13 dholland Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990, 1993 * Copyright (c) 1988, 1989, 1990, 1993
@ -69,7 +69,7 @@
*/ */
#ifndef MAKE_NATIVE #ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: main.c,v 1.181 2010/04/22 20:25:16 dholland Exp $"; static char rcsid[] = "$NetBSD: main.c,v 1.182 2010/04/22 22:39:13 dholland Exp $";
#else #else
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
#if 0 #if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else #else
__RCSID("$NetBSD: main.c,v 1.181 2010/04/22 20:25:16 dholland Exp $"); __RCSID("$NetBSD: main.c,v 1.182 2010/04/22 22:39:13 dholland Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
#endif #endif
@ -1967,7 +1967,7 @@ mkTempFile(const char *pattern, char **fnamep)
* Honor $TMPDIR but only if it is valid. * Honor $TMPDIR but only if it is valid.
* Ensure it ends with /. * Ensure it ends with /.
*/ */
tmpdir = Var_Subst(NULL, "${TMPDIR:tA:U/tmp}/", VAR_GLOBAL, 0); tmpdir = Var_Subst(NULL, "${TMPDIR:tA:U" _PATH_TMP "}/", VAR_GLOBAL, 0);
if (stat(tmpdir, &st) < 0 || !S_ISDIR(st.st_mode)) { if (stat(tmpdir, &st) < 0 || !S_ISDIR(st.st_mode)) {
free(tmpdir); free(tmpdir);
tmpdir = bmake_strdup(_PATH_TMP); tmpdir = bmake_strdup(_PATH_TMP);