[gnet] patch to fix build problem in inetaddr.c



Hello,

A little over a year ago I had a problem building gnet with an old
version of glibc.  Tim Müller was kind enough to apply a modified
version of a patch from Jeremy Denise to fix the problem. [1]

The fix involved using GNET_SOCKADDR_FAMILY() to access the ss_family
member of struct sockaddr instead of accessing it directly.  The
ss_family member of sockaddr on my system is called __ss_family and this
macro handles that.

In a recent (probably months old) change to inetaddr.c, ss_family was
accessed directly.  Here is a patch to change it to use
GNET_SOCKADDR_FAMILY instead.

Thanks,
Mark.

[1] http://lists.gnetlibrary.org/pipermail/gnet/2005-April/000418.html

--- gnet-2.0.8.orig/src/inetaddr.c Fri Aug 11 17:29:44 2006
+++ gnet-2.0.8/src/inetaddr.c Fri Aug 11 17:30:06 2006
@@ -145,7 +145,7 @@
 
       ia = g_new0(GInetAddr, 1);
       ia->ref_count = 1;
-      ia->sa.ss_family = he->h_addrtype;
+      GNET_SOCKADDR_FAMILY(ia->sa) = he->h_addrtype;
       GNET_INETADDR_SET_SS_LEN(ia);
       memcpy (GNET_SOCKADDR_ADDRP(ia->sa), he->h_addr_list[i],
he->h_length);
       list = g_list_prepend(list, ia);

Attachment: signature.asc
Description: This is a digitally signed message part



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