base: allow creating tempfile in a custom temporary dir.
Bug: http://b/70232908 Test: none. Change-Id: I24b894793f6725186b3582a91db083427e51aa5a
This commit is contained in:
parent
3946d93023
commit
464ea61143
2 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,7 @@
|
|||
class TemporaryFile {
|
||||
public:
|
||||
TemporaryFile();
|
||||
explicit TemporaryFile(const std::string& tmp_dir);
|
||||
~TemporaryFile();
|
||||
|
||||
// Release the ownership of fd, caller is reponsible for closing the
|
||||
|
|
|
@ -84,6 +84,10 @@ TemporaryFile::TemporaryFile() {
|
|||
init(GetSystemTempDir());
|
||||
}
|
||||
|
||||
TemporaryFile::TemporaryFile(const std::string& tmp_dir) {
|
||||
init(tmp_dir);
|
||||
}
|
||||
|
||||
TemporaryFile::~TemporaryFile() {
|
||||
if (fd != -1) {
|
||||
close(fd);
|
||||
|
|
Loading…
Reference in a new issue