diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-05-02 21:28:41 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-05-02 21:28:41 +0200 |
commit | 8ec77614f63e14d1869734b0d21a646667bbf88b (patch) | |
tree | a9227b8a7b22914385f0d0d983ade65f238f6842 /src/nix | |
parent | dea18ff99913349ef0f54b80d45c8dfdc8b31f65 (diff) |
Move createTempFile to libutil
Diffstat (limited to 'src/nix')
-rw-r--r-- | src/nix/shell.cc | 10 |
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 { |