mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-08 12:50:52 +00:00
posix: close fd on network down
This commit is contained in:
parent
0c26301252
commit
bc8e805046
@ -251,7 +251,7 @@ int btstack_network_up(bd_addr_t network_address){
|
||||
btstack_run_loop_add_data_source(&tap_dev_ds);
|
||||
btstack_run_loop_enable_data_source_callbacks(&tap_dev_ds, DATA_SOURCE_CALLBACK_READ);
|
||||
|
||||
return 0;;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -264,13 +264,16 @@ const char * btstack_network_get_name(void){
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Bring up network interfacd
|
||||
* @brief Bring up network interface
|
||||
* @param network_address
|
||||
* @return 0 if ok
|
||||
*/
|
||||
int btstack_network_down(void){
|
||||
log_info("BNEP channel closed");
|
||||
btstack_run_loop_remove_data_source(&tap_dev_ds);
|
||||
if (tap_fd >= 0){
|
||||
close(tap_fd);
|
||||
}
|
||||
tap_fd = -1;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user