btstack_run_loop_posix: log select errors, ignore data sources

This commit is contained in:
Matthias Ringwald 2022-10-31 14:22:56 +01:00
parent 20b1f198c3
commit c663093b19

View File

@ -55,6 +55,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/errno.h>
#include <sys/select.h>
#include <sys/time.h>
#include <time.h>
@ -208,8 +209,11 @@ static void btstack_run_loop_posix_execute(void) {
}
// wait for ready FDs
select( highest_fd+1 , &descriptors_read, &descriptors_write, NULL, timeout);
int res = select( highest_fd+1 , &descriptors_read, &descriptors_write, NULL, timeout);
if (res < 0){
log_error("btstack_run_loop_posix_execute: select -> errno %u", errno);
}
if (res > 0){
btstack_run_loop_posix_data_sources_modified = 0;
btstack_linked_list_iterator_init(&it, &btstack_run_loop_base_data_sources);
while (btstack_linked_list_iterator_has_next(&it) && !btstack_run_loop_posix_data_sources_modified){
@ -225,6 +229,7 @@ static void btstack_run_loop_posix_execute(void) {
ds->process(ds, DATA_SOURCE_CALLBACK_WRITE);
}
}
}
log_debug("btstack_run_loop_posix_execute: after ds check\n");
// process timers