rpms/libxcb/F-9 libxcb-1.1.91-abstract-socket.patch, NONE, 1.1 libxcb.spec, 1.6, 1.7
Adam Jackson
ajax at fedoraproject.org
Mon Oct 13 18:09:40 UTC 2008
Author: ajax
Update of /cvs/pkgs/rpms/libxcb/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16021
Modified Files:
libxcb.spec
Added Files:
libxcb-1.1.91-abstract-socket.patch
Log Message:
* Mon Oct 13 2008 Adam Jackson <ajax at redhat.com> 1.1-5
- libxcb-1.1{,.91}-abstract-socket.patch: Use the code from upstream.
libxcb-1.1.91-abstract-socket.patch:
--- NEW FILE libxcb-1.1.91-abstract-socket.patch ---
diff -up libxcb-1.1/configure.ac.abstract libxcb-1.1/configure.ac
--- libxcb-1.1/configure.ac.abstract 2008-10-13 14:03:41.000000000 -0400
+++ libxcb-1.1/configure.ac 2008-10-13 14:04:47.000000000 -0400
@@ -62,6 +62,8 @@
AC_SEARCH_LIBS(getaddrinfo, socket)
AC_SEARCH_LIBS(connect, socket)
+AC_DEFINE([HAVE_ABSTRACT_SOCKETS], 1, [Define if your platform supports abstract sockets])
+
xcbincludedir='${includedir}/xcb'
AC_SUBST(xcbincludedir)
--- libxcb-1.1/src/xcb_util.c.abstract 2007-10-23 12:44:59.000000000 -0400
+++ libxcb-1.1/src/xcb_util.c 2008-10-13 14:03:41.000000000 -0400
@@ -38,6 +38,7 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stddef.h>
#include <unistd.h>
#include <string.h>
@@ -123,6 +124,11 @@
#ifdef DNETCONN
static int _xcb_open_decnet(const char *host, char *protocol, const unsigned short port);
#endif
+#ifdef HAVE_ABSTRACT_SOCKETS
+static int _xcb_open_abstract(char *protocol, const char *file);
+#else
+#error d'oh
+#endif
static int _xcb_open(char *host, char *protocol, const int display)
{
@@ -156,10 +162,13 @@
/* display specifies Unix socket */
snprintf(file, sizeof(file), "%s%d", base, display);
- return _xcb_open_unix(protocol, file);
-
+#ifdef HAVE_ABSTRACT_SOCKETS
+ fd = _xcb_open_abstract(protocol, file);
+ if (fd >= 0 || (errno != ENOENT && errno != ECONNREFUSED))
+ return fd;
- return fd;
+#endif
+ return _xcb_open_unix(protocol, file);
}
#ifdef DNETCONN
@@ -259,6 +268,33 @@
return fd;
}
+#ifdef HAVE_ABSTRACT_SOCKETS
+static int _xcb_open_abstract(char *protocol, const char *file)
+{
+ int fd;
+ struct sockaddr_un addr = {0};
+ socklen_t namelen;
+
+ if (protocol && strcmp("unix",protocol))
+ return -1;
+
+ strcpy(addr.sun_path + 1, file);
+ addr.sun_family = AF_UNIX;
+ namelen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(file);
+#ifdef HAVE_SOCKADDR_SUN_LEN
+ addr.sun_len = 1 + strlen(file);
+#endif
+ fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (fd == -1)
+ return -1;
+ if (connect(fd, (struct sockaddr *) &addr, namelen) == -1) {
+ close(fd);
+ return -1;
+ }
+ return fd;
+}
+#endif
+
xcb_connection_t *xcb_connect(const char *displayname, int *screenp)
{
int fd, display = 0;
Index: libxcb.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libxcb/F-9/libxcb.spec,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- libxcb.spec 22 Apr 2008 17:18:07 -0000 1.6
+++ libxcb.spec 13 Oct 2008 18:09:10 -0000 1.7
@@ -10,7 +10,7 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0: libxcb-1.1-no-pthread-stubs.patch
-Patch1: libxcb-1.1-abstract-socket.patch
+Patch1: libxcb-1.1.91-abstract-socket.patch
Patch2: libxcb-1.1-sloppy-lock.patch
BuildRequires: autoconf automake libtool pkgconfig
@@ -82,6 +82,9 @@
%{_datadir}/doc/%{name}-%{version}
%changelog
+* Mon Oct 13 2008 Adam Jackson <ajax at redhat.com> 1.1-5
+- libxcb-1.1{,.91}-abstract-socket.patch: Use the code from upstream.
+
* Tue Apr 22 2008 Adam Jackson <ajax at redhat.com> 1.1-4
- libxcb-1.1-sloppy-lock.patch: Turn sloppy locking on all the time. I'm
tired of fighting it. (#390261)
More information about the scm-commits
mailing list