summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2010-01-11 09:16:42 +0000
committerharti <harti@FreeBSD.org>2010-01-11 09:16:42 +0000
commit58173f9fd7b4481664df3c1b6b29a2eda9da6680 (patch)
tree418b67d69cc24e62f41854dfee318b669322fd5a /usr.bin
parent5a323364a3bf19fe01567dbc172c23f949d5fe29 (diff)
downloadFreeBSD-src-58173f9fd7b4481664df3c1b6b29a2eda9da6680.zip
FreeBSD-src-58173f9fd7b4481664df3c1b6b29a2eda9da6680.tar.gz
Fix the previous commit (still not used to svn vs. cvs). Use the
define from paths.h for the default temporary directory and remove and unneccessary getenv call.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/make/job.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index 4d4afa6..beb83dc 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -115,6 +115,7 @@ __FBSDID("$FreeBSD$");
#include <fcntl.h>
#include <inttypes.h>
#include <limits.h>
+#include <paths.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
@@ -139,7 +140,6 @@ __FBSDID("$FreeBSD$");
#include "var.h"
#define TMPPAT "makeXXXXXXXXXX"
-#define TMPDIR "/tmp"
#ifndef USE_KQUEUE
/*
@@ -1611,7 +1611,7 @@ JobStart(GNode *gn, int flags, Job *previous)
}
if ((tdir = getenv("TMPDIR")) == NULL)
- tdir = TMPDIR;
+ tdir = _PATH_TMP;
/*
* If the -n flag wasn't given, we open up OUR (not the child's)
@@ -1807,8 +1807,6 @@ JobStart(GNode *gn, int flags, Job *previous)
} else {
fprintf(stdout, "Remaking `%s'\n", gn->name);
fflush(stdout);
- if ((tdir = getenv("TMPDIR")) == NULL)
- tdir = TMPDIR;
snprintf(job->outFile, sizeof(job->outFile), "%s/%s",
tdir, TMPPAT);
if ((job->outFd = mkstemp(job->outFile)) == -1)
OpenPOWER on IntegriCloud