diff --git a/src/hci_dump.c b/src/hci_dump.c index a18947fe6..34fb0ea35 100644 --- a/src/hci_dump.c +++ b/src/hci_dump.c @@ -41,8 +41,10 @@ static hcidump_hdr header_bluez; static pktlog_hdr header_packetlogger; void hci_dump_open(char *filename, hci_dump_format_t format){ - dump_file = open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU); - dump_format = format; + if (dump_file < 0) { + dump_file = open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU); + dump_format = format; + } } void hci_dump_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t len) { @@ -91,5 +93,6 @@ void hci_dump_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t void hci_dump_close(){ close(dump_file); + dump_file = -1; } diff --git a/src/hci_transport_h4.c b/src/hci_transport_h4.c index 3ce01cce4..e0c01b6f1 100644 --- a/src/hci_transport_h4.c +++ b/src/hci_transport_h4.c @@ -107,7 +107,6 @@ static int h4_open(void *transport_config){ } static int h4_close(){ - hci_dump_close(); close(fd); return 0; } diff --git a/src/main.c b/src/main.c index 0cb1e2ef5..6a74e6aa3 100644 --- a/src/main.c +++ b/src/main.c @@ -111,7 +111,7 @@ int main (int argc, const char * argv[]) { bt_control_t * control = NULL; -#if 1 +#if 0 // if (argc <= 1){ printf("HCI Daemon tester. Specify device name for Ericsson ROK 101 007\n");