Browse code

- openbsd fixes

Andrei Pelinescu-Onciul authored on 16/06/2005 14:49:58
Showing 2 changed files
... ...
@@ -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 286
 #ifndef HAVE_EPOLL
287 287
 			ret="epoll not supported, try re-compiling with -DHAVE_EPOLL";
288 288
 #else
289
-			if (get_sys_version(0,0,0)<0x020542) /* if ver < 2.5.66 */
289
+			if (os_ver<0x020542) /* if ver < 2.5.66 */
290 290
 			 	ret="epoll not supported on kernels < 2.6";
291 291
 #endif
292 292
 			break;
... ...
@@ -307,10 +309,12 @@ char* check_poll_method(enum poll_types poll_method)
307 307
 enum poll_types choose_poll_method()
308 308
 {
309 309
 	enum poll_types poll_method;
310
-	
310
+	unsigned int os_ver;
311
+
312
+	os_ver=get_sys_version(0,0,0);	
311 313
 	poll_method=0;
312 314
 #ifdef HAVE_EPOLL
313
-	if (get_sys_version(0,0,0)>=0x020542) /* if ver >= 2.5.66 */
315
+	if (os_ver>=0x020542) /* if ver >= 2.5.66 */
314 316
 		poll_method=POLL_EPOLL_LT; /* or POLL_EPOLL_ET */
315 317
 		
316 318
 #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>