| 685 | } |
| 686 | |
| 687 | static int port_select(hamlib_port_t *p, |
| 688 | int n, |
| 689 | fd_set *readfds, |
| 690 | fd_set *writefds, |
| 691 | fd_set *exceptfds, |
| 692 | struct timeval *timeout, |
| 693 | int direct) |
| 694 | { |
| 695 | #if 1 |
| 696 | |
| 697 | /* select does not work very well with writefds/exceptfds |
| 698 | * So let's pretend there's none of them |
| 699 | */ |
| 700 | if (exceptfds) |
| 701 | { |
| 702 | FD_ZERO(exceptfds); |
| 703 | } |
| 704 | |
| 705 | if (writefds) |
| 706 | { |
| 707 | FD_ZERO(writefds); |
| 708 | } |
| 709 | |
| 710 | writefds = NULL; |
| 711 | exceptfds = NULL; |
| 712 | #endif |
| 713 | |
| 714 | /* |
| 715 | * Since WIN32 does its special serial select, we have |
| 716 | * to catch the microHam case to do just "select". |
| 717 | * Note that we always have RIG_PORT_SERIAL in the |
| 718 | * microHam case. |
| 719 | */ |
| 720 | if (direct && is_uh_radio_fd(p->fd)) |
| 721 | { |
| 722 | return select(n, readfds, writefds, exceptfds, timeout); |
| 723 | } |
| 724 | |
| 725 | if (direct && p->type.rig == RIG_PORT_SERIAL) |
| 726 | { |
| 727 | return win32_serial_select(n, readfds, writefds, exceptfds, timeout); |
| 728 | } |
| 729 | else |
| 730 | { |
| 731 | return select(n, readfds, writefds, exceptfds, timeout); |
| 732 | } |
| 733 | } |
| 734 | |
| 735 | static int port_wait_for_data_direct(hamlib_port_t *p) |
| 736 | { |
no test coverage detected