aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-05-02 21:28:41 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-05-02 21:28:41 +0200
commit8ec77614f63e14d1869734b0d21a646667bbf88b (patch)
treea9227b8a7b22914385f0d0d983ade65f238f6842 /src/nix
parentdea18ff99913349ef0f54b80d45c8dfdc8b31f65 (diff)
Move createTempFile to libutil
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/shell.cc10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/nix/shell.cc b/src/nix/shell.cc
index d3ecf8de4..95028f10e 100644
--- a/src/nix/shell.cc
+++ b/src/nix/shell.cc
@@ -166,16 +166,6 @@ struct Common : InstallableCommand
}
};
-std::pair<AutoCloseFD, Path> createTempFile(const Path & prefix = "nix")
-{
- Path tmpl(getEnv("TMPDIR", "/tmp") + "/" + prefix + ".XXXXXX");
- // Strictly speaking, this is UB, but who cares...
- AutoCloseFD fd(mkstemp((char *) tmpl.c_str()));
- if (!fd)
- throw SysError("creating temporary file '%s'", tmpl);
- return {std::move(fd), tmpl};
-}
-
struct CmdDevShell : Common
{