$OpenBSD: patch-src_usocket_c,v 1.1 2006/01/21 01:32:40 jolan Exp $
--- src/usocket.c.orig	Thu Nov 24 14:29:38 2005
+++ src/usocket.c	Fri Jan 20 04:30:11 2006
@@ -11,6 +11,7 @@
 #include <string.h> 
 #include <signal.h>
 
+#include "lua.h"
 #include "socket.h"
 
 /*-------------------------------------------------------------------------*\
@@ -108,8 +109,13 @@ int socket_select(t_socket n, fd_set *rf
     do {
         struct timeval tv;
         double t = timeout_getretry(tm);
+#if LUA_NUMBER == int
+	tv.tv_sec = 0;
+	tv.tv_usec = (int)t*1000;
+#else
         tv.tv_sec = (int) t;
         tv.tv_usec = (int) ((t - tv.tv_sec) * 1.0e6);
+#endif
         /* timeout = 0 means no wait */
         ret = select(n, rfds, wfds, efds, t >= 0.0 ? &tv: NULL);
     } while (ret < 0 && errno == EINTR);
