[tyndur-devel] [PATCH 3/3] libc: POSIX: Fixes fuer select
Kevin Wolf ·
! libc: POSIX: select(): Sekunden sind das, was lang dauert, und Mikrosekunden das kurze. Nicht umgekehrt. ! libc: POSIX: select(): Ein Nullbyte ist eigentlich eine perfekte Eingabe, kein Fehler. Signed-off-by: Kevin Wolf <kevin at tyndur.org> --- src/modules/lib/posix/select.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/lib/posix/select.c b/src/modules/lib/posix/select.c index 539f555..9ae365c 100644 --- a/src/modules/lib/posix/select.c +++ b/src/modules/lib/posix/select.c @@ -67,8 +67,9 @@ int select(int number_fds, fd_set* readfds, fd_set* writefds, uint64_t timeout_tick; if (timeout != NULL) { - timeout_tick = get_tick_count() + timeout->tv_sec + - 1000ULL * 1000ULL * timeout->tv_usec; + timeout_tick = get_tick_count() + + 1000ULL * 1000ULL * timeout->tv_sec + + timeout->tv_usec; } else { timeout_tick = (uint64_t) -1; } @@ -101,7 +102,7 @@ int select(int number_fds, fd_set* readfds, fd_set* writefds, if (f != NULL) { c = fgetc(f); - if (c == 0 || c == EOF) { + if (c == EOF) { *rd &= ~(1 << i); } else { ungetc(c, f); -- 1.6.0.2
Antworten
- [tyndur-devel] [PATCH 3/3] libc: POSIX: Fixes fuer select · Antoine Kaufmann