Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-libs/gnutls/files: gnutls-2.12.20-AF_UNIX.patch
Date: Sun, 17 Jun 2012 08:54:19
Message-Id: 20120617085409.BE1D12004C@flycatcher.gentoo.org
1 grobian 12/06/17 08:54:09
2
3 Added: gnutls-2.12.20-AF_UNIX.patch
4 Log:
5 Add backport of AF_LOCAL/AF_UNIX fix from upstream to fix compilation on e.g. Solaris.
6
7 (Portage version: 2.2.01.20430-prefix/cvs/SunOS i386)
8
9 Revision Changes Path
10 1.1 net-libs/gnutls/files/gnutls-2.12.20-AF_UNIX.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-libs/gnutls/files/gnutls-2.12.20-AF_UNIX.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-libs/gnutls/files/gnutls-2.12.20-AF_UNIX.patch?rev=1.1&content-type=text/plain
14
15 Index: gnutls-2.12.20-AF_UNIX.patch
16 ===================================================================
17 Backport of commit 60a13b98e9f410c3b1019252f271d3c0f20b2e61 for 2.12.20
18
19 From 60a13b98e9f410c3b1019252f271d3c0f20b2e61 Mon Sep 17 00:00:00 2001
20 From: Nikos Mavrogiannopoulos <nmav@××××××.org>
21 Date: Fri, 23 Sep 2011 14:39:29 +0000
22 Subject: a hack to allow compilation on systems without AF_LOCAL.
23
24 --- lib/nettle/egd.c
25 +++ lib/nettle/egd.c
26 @@ -33,6 +33,12 @@
27
28 #include <gnutls_errors.h>
29
30 +#ifdef AF_UNIX
31 +# define LOCAL_SOCKET_TYPE AF_UNIX
32 +#else
33 +# define LOCAL_SOCKET_TYPE AF_LOCAL
34 +#endif
35 +
36 #ifndef offsetof
37 #define offsetof(type, member) ((size_t) &((type *)0)->member)
38 #endif
39 @@ -141,12 +147,12 @@
40 }
41
42 memset (&addr, 0, sizeof addr);
43 - addr.sun_family = AF_LOCAL;
44 + addr.sun_family = LOCAL_SOCKET_TYPE;
45 strcpy (addr.sun_path, name);
46 addr_len = (offsetof (struct sockaddr_un, sun_path)
47 + strlen (addr.sun_path));
48
49 - fd = socket (AF_LOCAL, SOCK_STREAM, 0);
50 + fd = socket (LOCAL_SOCKET_TYPE, SOCK_STREAM, 0);
51 if (fd == -1)
52 {
53 _gnutls_debug_log ("can't create unix domain socket: %s\n",