… | |
… | |
132 | #endif |
132 | #endif |
133 | |
133 | |
134 | tv.tv_sec = (long)timeout; |
134 | tv.tv_sec = (long)timeout; |
135 | tv.tv_usec = (long)((timeout - (ev_tstamp)tv.tv_sec) * 1e6); |
135 | tv.tv_usec = (long)((timeout - (ev_tstamp)tv.tv_sec) * 1e6); |
136 | |
136 | |
|
|
137 | #ifdef _WIN32 |
|
|
138 | /* pass in the write set as except set. |
|
|
139 | * the idea behind this is to work around a windows bug that causes |
|
|
140 | * errors to be reported as an exception and not by setting |
|
|
141 | * the writable bit. this is so uncontrollably lame. |
|
|
142 | */ |
|
|
143 | res = select (vec_max * NFDBITS, (fd_set *)vec_ro, (fd_set *)vec_wo, (fd_set *)vec_wo, &tv); |
|
|
144 | #else |
137 | res = select (vec_max * NFDBITS, (fd_set *)vec_ro, (fd_set *)vec_wo, 0, &tv); |
145 | res = select (vec_max * NFDBITS, (fd_set *)vec_ro, (fd_set *)vec_wo, 0, &tv); |
|
|
146 | #endif |
138 | |
147 | |
139 | if (expect_false (res < 0)) |
148 | if (expect_false (res < 0)) |
140 | { |
149 | { |
141 | #if EV_SELECT_IS_WINSOCKET |
150 | #if EV_SELECT_IS_WINSOCKET |
142 | errno = WSAGetLastError (); |
151 | errno = WSAGetLastError (); |