- /* This is the main silc_select(). The program blocks here until some
- of the selected file descriptors change status or the selected
- timeout expires. */
- SILC_LOG_DEBUG(("Select"));
- ret = schedule_ops.select(schedule, schedule->internal);
-
- switch (ret) {
- case 0:
- /* Timeout */
- SILC_LOG_DEBUG(("Running timeout tasks"));
- silc_schedule_dispatch_timeout(schedule, FALSE);
- break;
- case -1:
- /* Error */
- if (errno == EINTR)
- break;
- SILC_LOG_ERROR(("Error in select(): %s", strerror(errno)));
- break;
- default:
- /* There is some data available now */
- SILC_LOG_DEBUG(("Running fd tasks"));
- silc_schedule_dispatch_fd(schedule);
- break;
- }
+ } else if (silc_likely(ret > 0)) {
+ /* There is some data available now */
+ SILC_LOG_DEBUG(("Running fd tasks"));
+ silc_schedule_dispatch_fd(schedule);
+ continue;