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

Commit 632ec8ad authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "test: log capture add fd sync"

parents 8b89988e 82be955c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -89,6 +89,12 @@ void LogCapture::Flush() {
  }
}

void LogCapture::Sync() {
  if (fd_ != -1) {
    fsync(fd_);
  }
}

void LogCapture::Reset() {
  if (fd_ != -1) {
    if (ftruncate(fd_, 0UL) == -1) {
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ class LogCapture {
  std::string Read();
  // Flushes contents of log capture back to |stderr|
  void Flush();
  // Synchronize buffer contents to file descriptor
  void Sync();
  // Returns the backing store size in bytes
  size_t Size() const;
  // Truncates and resets the file pointer discarding all logs up to this point