Skip to content

Commit

Permalink
fixup! posix_select: initial import of select() function
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Jul 1, 2020
1 parent c14e9de commit f3282f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sys/posix/select/posix_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds,
while (wait) {
if (_set_timeout(&timeout_timer, timeout,
xtimer_now_usec() - start_time, &wait) < 0) {
fds_set = -1;
goto end;
/* timeout setting failed so not set, so no need to go to end */
return -1;
}
if (!wait) {
/* timeout was reached, timeout was not set, so no need to
* go to end */
errno = -EINTR;
errno = EINTR;
return -1;
}
thread_flags_t tflags = thread_flags_wait_any(POSIX_SELECT_THREAD_FLAG |
Expand All @@ -140,7 +140,7 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds,
}
}
else if (tflags & THREAD_FLAG_TIMEOUT) {
errno = -EINTR;
errno = EINTR;
/* timeout fired, so no need to go to end */
return -1;
}
Expand Down

0 comments on commit f3282f8

Please sign in to comment.