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

Commit 82be955c authored by Chris Manton's avatar Chris Manton Committed by Qasim Javed
Browse files

test: log capture add fd sync

Bug: 244092860
Test: atest bluetooth_test_gd_unit bluetooth_test_gd
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I5c60363de865463a6a441e8c5e622713c25496b2
parent a21f10ff
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
@@ -35,6 +35,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