diff --git a/TODO.txt b/TODO.txt index 9ce4ecc02..3bcdfe11b 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,6 +1,7 @@ /* new todo file for BTstack */ NEXT: +- try to have BTdaemon use 0% cpu time when idle, after disconnect - implement cocoa_remove_data_source - fix BTstack and/or WiiMote Demo crash when quitting app - prepend all source files with 'new BSD' copyright header diff --git a/src/run_loop_posix.c b/src/run_loop_posix.c index 4691e43eb..8f0855021 100644 --- a/src/run_loop_posix.c +++ b/src/run_loop_posix.c @@ -94,11 +94,9 @@ void posix_execute() { tv.tv_usec += 1000000; tv.tv_sec--; } - if (tv.tv_sec < 0){ - tv.tv_sec = 0; - tv.tv_usec = 0; + if (tv.tv_sec > 0 || (tv.tv_sec == 0 && tv.tv_usec > 0)){ + timeout = &tv; } - timeout = &tv; } // wait for ready FDs