[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#467542: gmyth: FTBFS on GNU/kFreeBSD



Package: gmyth
Severity: important
Version: 0.7.debian1-1
Tags: patch
X-Debbugs-CC: debian-bsd@lists.debian.org
User: glibc-bsd-devel@lists.alioth.debian.org
Usertags: kfreebsd

Hi,

as you notified us:

one of my packages, gmyth, fails to build on GNU/kFreeBSD:
In file included from gmyth_util.c:42:
/usr/include/sys/timex.h:178: error: field 'time' has incomplete type
/usr/include/sys/timex.h:184: error: field 'time' has incomplete type

Is this just a broken header or a bug in the package?

This is a problem with altering internal glibc defines in gmyth_util.c.
It can be easily workarrounded/fixed in your package.
For GNU/kFreeBSD the following start of gmyth_util.c is sufficient:

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#define _XOPEN_SOURCE 600
#define _XOPEN_SOURCE_EXTENDED

#include <glib.h>


There is also another problem in gmyth_socket.c, there is a mixture of usage "struct ifaddr" (it does not exist on GNU/kFreeBSD) and
textual representation of IP address.

Please find attached patch with proposed changes.

It would also be nice if you can ask upstream
to include this changes.

Thanks in advance

                        Petr
only in patch2:
unchanged:
--- gmyth-0.7.debian1.orig/src/gmyth_util.c
+++ gmyth-0.7.debian1/src/gmyth_util.c
@@ -30,7 +30,7 @@
 #include "config.h"
 #endif
 
-#define _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
 #define _XOPEN_SOURCE_EXTENDED
 #define __USE_MISC
 
only in patch2:
unchanged:
--- gmyth-0.7.debian1.orig/src/gmyth_socket.c
+++ gmyth-0.7.debian1/src/gmyth_socket.c
@@ -203,7 +203,7 @@
             continue;
         g_strlcpy(ifaddr,
                   inet_ntoa(((struct sockaddr_in *) &req.ifr_addr)->
-                            sin_addr), sizeof(struct ifaddr) - 1);
+                            sin_addr), sizeof(ifaddr));
         local_addrs = g_list_append(local_addrs, g_strdup(ifaddr));
 
         gmyth_debug
@@ -221,7 +221,7 @@
 gchar          *
 gmyth_socket_get_primary_addr(void)
 {
-    gchar          *if_eth0 = g_new0(gchar, sizeof(struct ifaddr) - 1);
+    gchar          *if_eth0 = g_new0(gchar, 20+1);
     GList          *if_tmp = NULL;
 
     GList          *interfs = gmyth_socket_get_local_addrs(NULL);
@@ -231,8 +231,7 @@
         if_tmp = g_list_first(interfs);
 
         if (if_tmp != NULL)
-            g_strlcpy(if_eth0, (gchar *) if_tmp->data,
-                      sizeof(struct ifaddr) - 1);
+            g_strlcpy(if_eth0, (gchar *) if_tmp->data, 20+1);
 
     }
 

Reply to: