Diff between bbe209ce190c25008d8ffca6143b700ec4ff2c55 and 303b8b7757fc5c755ceeabe025cfc92a90bd694b

Changed Files

File Additions Deletions Status
monitor/btsnoop.c +4 -1 modified
monitor/btsnoop.h +1 -1 modified
monitor/control.c +2 -1 modified

Full Patch

diff --git a/monitor/btsnoop.c b/monitor/btsnoop.c
index 49d3998..79997c4 100644
--- a/monitor/btsnoop.c
+++ b/monitor/btsnoop.c
@@ -165,7 +165,7 @@ void btsnoop_write(struct timeval *tv, uint16_t index, uint16_t opcode,
 	do_write(tv, flags, data, size);
 }
 
-int btsnoop_open(const char *path)
+int btsnoop_open(const char *path, uint32_t *type)
 {
 	struct btsnoop_hdr hdr;
 	ssize_t len;
@@ -216,6 +216,9 @@ int btsnoop_open(const char *path)
 		break;
 	}
 
+	if (type)
+		*type = btsnoop_type;
+
 	return 0;
 }
 
diff --git a/monitor/btsnoop.h b/monitor/btsnoop.h
index 044d1a2..cec9761 100644
--- a/monitor/btsnoop.h
+++ b/monitor/btsnoop.h
@@ -27,7 +27,7 @@
 void btsnoop_create(const char *path);
 void btsnoop_write(struct timeval *tv, uint16_t index, uint16_t opcode,
 					const void *data, uint16_t size);
-int btsnoop_open(const char *path);
+int btsnoop_open(const char *path, uint32_t *type);
 int btsnoop_read(struct timeval *tv, uint16_t *index, uint16_t *opcode,
 						void *data, uint16_t *size);
 void btsnoop_close(void);
diff --git a/monitor/control.c b/monitor/control.c
index d4085ef..8db33d6 100644
--- a/monitor/control.c
+++ b/monitor/control.c
@@ -810,9 +810,10 @@ void control_reader(const char *path)
 {
 	unsigned char buf[MAX_PACKET_SIZE];
 	uint16_t index, opcode, pktlen;
+	uint32_t type;
 	struct timeval tv;
 
-	if (btsnoop_open(path) < 0)
+	if (btsnoop_open(path, &type) < 0)
 		return;
 
 	open_pager();