don't cache transport fd

This commit is contained in:
matthias.ringwald 2009-06-03 21:36:59 +00:00
parent c095e79e4d
commit 1f6803779e

View File

@ -111,7 +111,7 @@ int main (int argc, const char * argv[]) {
bt_control_t * control = NULL; bt_control_t * control = NULL;
#if 0 #if 1
// //
if (argc <= 1){ if (argc <= 1){
printf("HCI Daemon tester. Specify device name for Ericsson ROK 101 007\n"); printf("HCI Daemon tester. Specify device name for Ericsson ROK 101 007\n");
@ -152,9 +152,6 @@ int main (int argc, const char * argv[]) {
// init L2CAP // init L2CAP
l2cap_init(); l2cap_init();
// get fd for select call
int transport_fd = transport->get_fd();
// //
fd_set descriptors; fd_set descriptors;
FD_ZERO(&descriptors); FD_ZERO(&descriptors);
@ -162,6 +159,8 @@ int main (int argc, const char * argv[]) {
// handle HCI // handle HCI
hci_run(); hci_run();
// get fd for select call
int transport_fd = transport->get_fd();
FD_SET(transport_fd, &descriptors); FD_SET(transport_fd, &descriptors);
// int ready = // int ready =
select( transport_fd+1, &descriptors, NULL, NULL, NULL); select( transport_fd+1, &descriptors, NULL, NULL, NULL);