Hi,

The time64 changes have exposed a bug in elinks. Due to reasons that don't
apply to us, elinks defines it's own timeval_t (called timeval_T) with a
long seconds field. The authors pass pointers to these into select(2), thus
causing select to fail on some arches (e.g. i386 or any where a long is 4
bytes). The upshot of this is that elinks may fail to start, complaining
that select(2) failed.

The following diff fixes this. A patch is also regenerated. OK?

Index: Makefile
===================================================================
RCS file: /home/edd/cvsync/cvs/ports/www/elinks/Makefile,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile
--- Makefile    11 Mar 2013 11:44:41 -0000      1.31
+++ Makefile    8 Oct 2013 22:39:52 -0000
@@ -2,7 +2,7 @@
 
 COMMENT=               full-featured text WWW browser
 DISTNAME=              elinks-0.11.7
-REVISION=              6
+REVISION=              7
 CATEGORIES=            www
 MASTER_SITES=          http://elinks.cz/download/
 
Index: patches/patch-src_scripting_lua_core_c
===================================================================
RCS file: 
/home/edd/cvsync/cvs/ports/www/elinks/patches/patch-src_scripting_lua_core_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_scripting_lua_core_c
--- patches/patch-src_scripting_lua_core_c      21 Aug 2008 01:12:35 -0000      
1.2
+++ patches/patch-src_scripting_lua_core_c      8 Oct 2013 22:39:55 -0000
@@ -1,7 +1,7 @@
 $OpenBSD: patch-src_scripting_lua_core_c,v 1.2 2008/08/21 01:12:35 sthen Exp $
---- src/scripting/lua/core.c.orig      Fri Jun 20 21:19:55 2008
-+++ src/scripting/lua/core.c   Sat Aug  2 21:57:51 2008
-@@ -641,7 +641,7 @@ do_hooks_file(LS, unsigned char *prefix, unsigned char
+--- src/scripting/lua/core.c.orig      Sat Aug 22 12:15:08 2009
++++ src/scripting/lua/core.c   Tue Oct  8 23:28:54 2013
+@@ -645,7 +645,7 @@ do_hooks_file(LS, unsigned char *prefix, unsigned char
        if (file_can_read(file)) {
                int oldtop = lua_gettop(S);
  
@@ -10,7 +10,7 @@ $OpenBSD: patch-src_scripting_lua_core_c
                        sleep(3); /* Let some time to see error messages. */
                lua_settop(S, oldtop);
        }
-@@ -652,13 +652,24 @@ do_hooks_file(LS, unsigned char *prefix, unsigned char
+@@ -656,13 +656,24 @@ do_hooks_file(LS, unsigned char *prefix, unsigned char
  void
  init_lua(struct module *module)
  {
@@ -40,7 +40,7 @@ $OpenBSD: patch-src_scripting_lua_core_c
  
        lua_register(L, LUA_ALERT, l_alert);
        lua_register(L, "current_url", l_current_url);
-@@ -763,7 +774,7 @@ handle_ret_eval(struct session *ses)
+@@ -767,7 +778,7 @@ handle_ret_eval(struct session *ses)
                int oldtop = lua_gettop(L);
  
                if (prepare_lua(ses) == 0) {
Index: patches/patch-src_util_time_h
===================================================================
RCS file: patches/patch-src_util_time_h
diff -N patches/patch-src_util_time_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_util_time_h       10 Oct 2013 15:54:38 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+Elinks defines it's own timeval struct which is incompatible with OpenBSD's.
+Further, the member names differ from the OpenBSD timeval struct.
+
+It is easier to fix the types in their definition than to define timeval_T
+to timeval_t and patch every use site.
+
+--- src/util/time.h.orig       Tue Oct  8 23:46:40 2013
++++ src/util/time.h    Tue Oct  8 23:47:33 2013
+@@ -23,7 +23,7 @@ typedef long milliseconds_T;
+ /* Redefine a timeval that has all fields signed so calculations
+  * will be simplified on rare systems that define timeval with
+  * unsigned fields. */
+-typedef struct { long sec; long usec; } timeval_T;
++typedef struct { time_t sec; long usec; } timeval_T;
+ 
+ timeval_T *timeval_from_milliseconds(timeval_T *t, milliseconds_T 
milliseconds);
+ timeval_T *timeval_from_seconds(timeval_T *t, long seconds);


-- 
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk

Reply via email to