Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d773ceb2 authored by Yabin Cui's avatar Yabin Cui Committed by android-build-merger
Browse files

Merge "base: allow creating tempfile in a custom temporary dir."

am: 665f1445

Change-Id: Ibf63af87835763700682163cbe8feb60dc081b01
parents 5e206966 665f1445
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@
class TemporaryFile {
class TemporaryFile {
 public:
 public:
  TemporaryFile();
  TemporaryFile();
  explicit TemporaryFile(const std::string& tmp_dir);
  ~TemporaryFile();
  ~TemporaryFile();


  // Release the ownership of fd, caller is reponsible for closing the
  // Release the ownership of fd, caller is reponsible for closing the
+4 −0
Original line number Original line Diff line number Diff line
@@ -84,6 +84,10 @@ TemporaryFile::TemporaryFile() {
  init(GetSystemTempDir());
  init(GetSystemTempDir());
}
}


TemporaryFile::TemporaryFile(const std::string& tmp_dir) {
  init(tmp_dir);
}

TemporaryFile::~TemporaryFile() {
TemporaryFile::~TemporaryFile() {
  if (fd != -1) {
  if (fd != -1) {
    close(fd);
    close(fd);