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

Commit 6f007b39 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Fix the calling pattern of the debug dump functions

Group together the calls to the internal foo_dump() functions,
so the output file descriptor is not closed prematurely.

Bug: 26847370
Change-Id: I3afc9502169424081efcc5deae055fbbd91ed5f1
parent eb93a32a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@
// Debug API

void btif_debug_init(void);
void btif_debug_dump(int fd);

// Debug helpers

+2 −1
Original line number Diff line number Diff line
@@ -323,7 +323,8 @@ static int read_energy_info()

static void dump(int fd, UNUSED_ATTR const char **arguments)
{
    btif_debug_dump(fd);
    btif_debug_conn_dump(fd);
    wakelock_debug_dump(fd);
    alarm_debug_dump(fd);
#if defined(BTSNOOP_MEM) && (BTSNOOP_MEM == TRUE)
    btif_debug_btsnoop_dump(fd);
+0 −10
Original line number Diff line number Diff line
@@ -31,16 +31,6 @@ void btif_debug_init(void) {
#endif
}

void btif_debug_dump(int fd) {
  btif_debug_conn_dump(fd);
  wakelock_debug_dump(fd);
#if defined(BTSNOOP_MEM) && (BTSNOOP_MEM == TRUE)
  btif_debug_btsnoop_dump(fd);
#endif

  close(fd);
}

// TODO: Find a better place for this to enable additional re-use
uint64_t btif_debug_ts(void) {
  struct timeval tv;