Loading system/gd/hal/snoop_logger.cc +9 −2 Original line number Diff line number Diff line Loading @@ -548,17 +548,21 @@ void SnoopLogger::OpenNextSnoopLogFile() { file_creation_time = fake_timerfd_get_clock(); #endif if (!btsnoop_ostream_.good()) { log::fatal("Unable to open snoop log at \"{}\", error: \"{}\"", snoop_log_path_, log::error("Unable to open snoop log at \"{}\", error: \"{}\"", snoop_log_path_, strerror(errno)); return; } umask(prevmask); if (!btsnoop_ostream_.write(reinterpret_cast<const char*>(&SnoopLoggerCommon::kBtSnoopFileHeader), sizeof(SnoopLoggerCommon::FileHeaderType))) { log::fatal("Unable to write file header to \"{}\", error: \"{}\"", snoop_log_path_, log::error("Unable to write file header to \"{}\", error: \"{}\"", snoop_log_path_, strerror(errno)); btsnoop_ostream_.close(); return; } if (!btsnoop_ostream_.flush()) { log::error("Failed to flush, error: \"{}\"", strerror(errno)); return; } } Loading Loading @@ -1191,6 +1195,9 @@ void SnoopLogger::Capture(const HciPacket& immutable_packet, Direction direction if (packet_counter_ > max_packets_per_file_) { OpenNextSnoopLogFile(); } if (!btsnoop_ostream_.is_open() || !btsnoop_ostream_.good()) { return; } if (!btsnoop_ostream_.write(reinterpret_cast<const char*>(&header), sizeof(PacketHeaderType))) { log::error("Failed to write packet header for btsnoop, error: \"{}\"", strerror(errno)); } Loading Loading
system/gd/hal/snoop_logger.cc +9 −2 Original line number Diff line number Diff line Loading @@ -548,17 +548,21 @@ void SnoopLogger::OpenNextSnoopLogFile() { file_creation_time = fake_timerfd_get_clock(); #endif if (!btsnoop_ostream_.good()) { log::fatal("Unable to open snoop log at \"{}\", error: \"{}\"", snoop_log_path_, log::error("Unable to open snoop log at \"{}\", error: \"{}\"", snoop_log_path_, strerror(errno)); return; } umask(prevmask); if (!btsnoop_ostream_.write(reinterpret_cast<const char*>(&SnoopLoggerCommon::kBtSnoopFileHeader), sizeof(SnoopLoggerCommon::FileHeaderType))) { log::fatal("Unable to write file header to \"{}\", error: \"{}\"", snoop_log_path_, log::error("Unable to write file header to \"{}\", error: \"{}\"", snoop_log_path_, strerror(errno)); btsnoop_ostream_.close(); return; } if (!btsnoop_ostream_.flush()) { log::error("Failed to flush, error: \"{}\"", strerror(errno)); return; } } Loading Loading @@ -1191,6 +1195,9 @@ void SnoopLogger::Capture(const HciPacket& immutable_packet, Direction direction if (packet_counter_ > max_packets_per_file_) { OpenNextSnoopLogFile(); } if (!btsnoop_ostream_.is_open() || !btsnoop_ostream_.good()) { return; } if (!btsnoop_ostream_.write(reinterpret_cast<const char*>(&header), sizeof(PacketHeaderType))) { log::error("Failed to write packet header for btsnoop, error: \"{}\"", strerror(errno)); } Loading