... | ... |
@@ -267,7 +267,9 @@ char* check_poll_method(enum poll_types poll_method) |
267 | 267 |
{ |
268 | 268 |
char* ret; |
269 | 269 |
ret=0; |
270 |
- |
|
270 |
+ unsigned int os_ver; |
|
271 |
+ |
|
272 |
+ os_ver=get_sys_version(0,0,0); |
|
271 | 273 |
switch(poll_method){ |
272 | 274 |
case POLL_NONE: |
273 | 275 |
break; |
... | ... |
@@ -286,7 +288,7 @@ char* check_poll_method(enum poll_types poll_method) |
286 | 288 |
#ifndef HAVE_EPOLL |
287 | 289 |
ret="epoll not supported, try re-compiling with -DHAVE_EPOLL"; |
288 | 290 |
#else |
289 |
- if (get_sys_version(0,0,0)<0x020542) /* if ver < 2.5.66 */ |
|
291 |
+ if (os_ver<0x020542) /* if ver < 2.5.66 */ |
|
290 | 292 |
ret="epoll not supported on kernels < 2.6"; |
291 | 293 |
#endif |
292 | 294 |
break; |
... | ... |
@@ -307,10 +309,12 @@ char* check_poll_method(enum poll_types poll_method) |
307 | 309 |
enum poll_types choose_poll_method() |
308 | 310 |
{ |
309 | 311 |
enum poll_types poll_method; |
310 |
- |
|
312 |
+ unsigned int os_ver; |
|
313 |
+ |
|
314 |
+ os_ver=get_sys_version(0,0,0); |
|
311 | 315 |
poll_method=0; |
312 | 316 |
#ifdef HAVE_EPOLL |
313 |
- if (get_sys_version(0,0,0)>=0x020542) /* if ver >= 2.5.66 */ |
|
317 |
+ if (os_ver>=0x020542) /* if ver >= 2.5.66 */ |
|
314 | 318 |
poll_method=POLL_EPOLL_LT; /* or POLL_EPOLL_ET */ |
315 | 319 |
|
316 | 320 |
#endif |
... | ... |
@@ -65,6 +65,11 @@ |
65 | 65 |
#include <sys/epoll.h> |
66 | 66 |
#endif |
67 | 67 |
#ifdef HAVE_SELECT |
68 |
+/* needed on openbsd for select*/ |
|
69 |
+#include <sys/time.h> |
|
70 |
+#include <sys/types.h> |
|
71 |
+#include <unistd.h> |
|
72 |
+/* needed according to POSIX for select*/ |
|
68 | 73 |
#include <sys/select.h> |
69 | 74 |
#endif |
70 | 75 |
#include <sys/poll.h> |