about summary refs log tree commit diff
path: root/src/exec.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-10-02T11·55+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-10-02T11·55+0000
commit4193d62e08964e2c26b27674e33327bf0417bab5 (patch)
tree682be5e80e0ea2b3adaa0f715974549d9d88d2fc /src/exec.cc
parent6d478597c7672efc546b6720c8404ffb5f998612 (diff)
* Nix now respects $TMPDIR for the creation of temporary build directories.
* Retry creation of a temporary directory (with a different name) in the 
  case of EEXIST.

Diffstat (limited to 'src/exec.cc')
-rw-r--r--src/exec.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/exec.cc b/src/exec.cc
index e9ddb5ee14ca..2e092b2e0dd6 100644
--- a/src/exec.cc
+++ b/src/exec.cc
@@ -54,11 +54,7 @@ void runProgram(const string & program,
 
     /* Create a temporary directory where the build will take
        place. */
-    static int counter = 0;
-    string tmpDir = (format("/tmp/nix-%1%-%2%") % getpid() % counter++).str();
-
-    if (mkdir(tmpDir.c_str(), 0777) == -1)
-        throw SysError(format("creating directory `%1%'") % tmpDir);
+    string tmpDir = createTempDir();
 
     AutoDelete delTmpDir(tmpDir);