Hello community,
here is the log from the commit of package xorg-x11-libxcb for openSUSE:Factory
checked in at Thu Sep 9 15:07:38 CEST 2010.
--------
--- xorg-x11-libxcb/xorg-x11-libxcb.changes 2010-07-03 09:17:29.000000000 +0200
+++ /mounts/work_src_done/STABLE/xorg-x11-libxcb/xorg-x11-libxcb.changes 2010-09-04 21:08:16.000000000 +0200
@@ -1,0 +2,7 @@
+Sat Sep 4 19:03:26 UTC 2010 - sndirsch@novell.com
+
+- update to release 1.7
+- bumped version number to 7.5_1.7
+- fixed Summary/Group entries in -devel package
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
libxcb-1.5.tar.bz2
New:
----
libxcb-1.7.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xorg-x11-libxcb.spec ++++++
--- /var/tmp/diff_new_pack.OpzOpM/_old 2010-09-09 15:06:23.000000000 +0200
+++ /var/tmp/diff_new_pack.OpzOpM/_new 2010-09-09 15:06:23.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package xorg-x11-libxcb (Version 7.5)
+# spec file for package xorg-x11-libxcb (Version 7.5_1.7)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,7 +19,7 @@
Name: xorg-x11-libxcb
-%define dirsuffix 1.5
+%define dirsuffix 1.7
BuildRequires: libxslt pkgconfig python-base python-xml xorg-x11-libXau-devel xorg-x11-proto-devel
#%ifarch ppc64 s390x x86_64
#Provides: libxcb-xlib.so.0()(64bit)
@@ -27,8 +27,8 @@
#Provides: libxcb-xlib.so.0
#%endif
Url: http://xorg.freedesktop.org/
-Version: 7.5
-Release: 2
+Version: 7.5_%{dirsuffix}
+Release: 1
License: MIT License (or similar)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: System/Libraries
@@ -52,7 +52,7 @@
%package devel
License: MIT License (or similar)
Summary: Include Files and Libraries mandatory for Development
-Group: System/Libraries
+Group: Development/Libraries/X11
Requires: xorg-x11-proto-devel xorg-x11-libXau-devel %{name} = %{version}
AutoReqProv: on
++++++ libxcb-1.5.tar.bz2 -> libxcb-1.7.tar.bz2 ++++++
++++ 4050 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/configure.ac new/libxcb-1.7/configure.ac
--- old/libxcb-1.5/configure.ac 2009-12-03 10:08:32.000000000 +0100
+++ new/libxcb-1.7/configure.ac 2010-08-13 13:46:22.000000000 +0200
@@ -3,7 +3,7 @@
AC_PREREQ(2.57)
AC_INIT([libxcb],
- 1.5,
+ 1.7,
[xcb@lists.freedesktop.org])
AC_CONFIG_SRCDIR([xcb.pc.in])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -32,7 +32,7 @@
AC_SUBST(HTML_CHECK_RESULT)
# Checks for pkg-config packages
-PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.5)
+PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.6)
NEEDED="pthread-stubs xau >= 0.99.2"
PKG_CHECK_MODULES(NEEDED, $NEEDED)
@@ -121,9 +121,8 @@
XCB_CHECK_DOXYGEN()
case $host_os in
- # darwin has poll() but can't be used to poll character devices
- # darwin10 (SnowLeopard) should be tested as well once released
- darwin7*) ;; darwin8*) ;; darwin9*) ;;
+ # darwin has poll() but can't be used to poll character devices (atleast through SnowLeopard)
+ darwin*) ;;
*)
AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], )
;;
@@ -156,7 +155,7 @@
AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
if test "x$LAUNCHD" = xauto; then
unset LAUNCHD
- AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no])
+ AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no], [$PATH$PATH_SEPARATOR/sbin])
fi
if test "x$LAUNCHD" = xyes ; then
@@ -213,6 +212,31 @@
echo " Build unit tests....: ${HAVE_CHECK}"
echo " XCB buffer size.....: ${xcb_queue_buffer_size}"
echo ""
+echo " X11 extensions"
+echo " Composite...........: ${BUILD_COMPOSITE}"
+echo " Damage..............: ${BUILD_DAMAGE}"
+echo " Dpms................: ${BUILD_DPMS}"
+echo " Dri2................: ${BUILD_DRI2}"
+echo " Glx.................: ${BUILD_GLX}"
+echo " Randr...............: ${BUILD_RANDR}"
+echo " Record..............: ${BUILD_RECORD}"
+echo " Render..............: ${BUILD_RENDER}"
+echo " Resource............: ${BUILD_RESOURCE}"
+echo " Screensaver.........: ${BUILD_SCREENSAVER}"
+echo " selinux.............: ${BUILD_SELINUX}"
+echo " Shape...............: ${BUILD_SHAPE}"
+echo " Shm.................: ${BUILD_SHM}"
+echo " Sync................: ${BUILD_SYNC}"
+echo " Xevie...............: ${BUILD_XEVIE}"
+echo " Xfixes..............: ${BUILD_XFIXES}"
+echo " Xfree86-dri.........: ${BUILD_XFREE86_DRI}"
+echo " xinerama............: ${BUILD_XINERAMA}"
+echo " xinput..............: ${BUILD_XINPUT}"
+echo " xprint..............: ${BUILD_XPRINT}"
+echo " xtest...............: ${BUILD_XTEST}"
+echo " xv..................: ${BUILD_XV}"
+echo " xvmc................: ${BUILD_XVMC}"
+echo ""
echo " Used CFLAGS:"
echo " CPPFLAGS............: ${CPPFLAGS}"
echo " CFLAGS..............: ${CFLAGS}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/doc/tutorial/index.html new/libxcb-1.7/doc/tutorial/index.html
--- old/libxcb-1.5/doc/tutorial/index.html 2009-11-06 11:19:22.000000000 +0100
+++ new/libxcb-1.7/doc/tutorial/index.html 2010-08-13 13:43:31.000000000 +0200
@@ -471,8 +471,6 @@
diff = end - start;
/* free var */
- for (i = 0; i < count; ++i)
- free (names[i]);
free (atoms);
free (cs);
@@ -494,6 +492,8 @@
printf ("ratio : %f\n", diff_x / diff);
free (atoms_x);
+ for (i = 0; i < count; ++i)
+ free (names[i]);
free (names);
XCloseDisplay (disp);
@@ -1453,7 +1453,7 @@
</pre>
<p>
If the window has already been created, we can use the
- <span class="code">xcb_configure_window()</span> function to set
+ <span class="code">xcb_change_window_attributes()</span> function to set
the events that the window will receive. The subsection
<a href="#winconf">Configuring a window</a> shows its
prototype. As an example, here is a piece of code that
@@ -1466,7 +1466,7 @@
/* The connection c and the window win are supposed to be defined */
-xcb_configure_window (c, win, XCB_CW_EVENT_MASK, values);
+xcb_change_window_attributes (c, win, XCB_CW_EVENT_MASK, values);
</pre>
<div class="emph">
<p>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/NEWS new/libxcb-1.7/NEWS
--- old/libxcb-1.5/NEWS 2009-12-03 10:08:17.000000000 +0100
+++ new/libxcb-1.7/NEWS 2010-08-13 13:45:51.000000000 +0200
@@ -1,3 +1,20 @@
+Release 1.7 (2010-08-13)
+========================
+- Always wake up readers after writing
+- Get rid of PATH_MAX and MAXPATHLEN
+- Add ~ operator support in code generator
+- xcb_open: Improve protocol/host parsing
+- xcb_connect_to_display_with_auth_info: Fix memory leak
+- Report which extensions are being built
+
+Release 1.6 (2010-04-09)
+========================
+- darwin: xnu doesn't support poll on ttys on the master side
+- Fix descriptor leak on memory error path
+- Support xcb_discard_reply
+- Open the X11 socket with close-on-exec flag
+- Fix authentication on hpux and Hurd
+
Release 1.5 (2009-12-03)
========================
- setsockopt(SO_KEEPALIVE) on TCP display connections
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/src/c_client.py new/libxcb-1.7/src/c_client.py
--- old/libxcb-1.5/src/c_client.py 2009-03-15 19:57:56.000000000 +0100
+++ new/libxcb-1.7/src/c_client.py 2010-08-13 13:43:31.000000000 +0200
@@ -448,7 +448,9 @@
'''
lenexp = _c_accessor_get_length(expr, prefix)
- if expr.op != None:
+ if expr.op == '~':
+ return '(' + '~' + _c_accessor_get_expr(expr.rhs, prefix) + ')'
+ elif expr.op != None:
return '(' + _c_accessor_get_expr(expr.lhs, prefix) + ' ' + expr.op + ' ' + _c_accessor_get_expr(expr.rhs, prefix) + ')'
elif expr.bitfield:
return 'xcb_popcount(' + lenexp + ')'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/src/Makefile.am new/libxcb-1.7/src/Makefile.am
--- old/libxcb-1.5/src/Makefile.am 2009-12-03 10:05:11.000000000 +0100
+++ new/libxcb-1.7/src/Makefile.am 2009-12-10 14:43:43.000000000 +0100
@@ -1,14 +1,8 @@
lib_LTLIBRARIES = libxcb.la
-EXTHEADERS = xproto.h \
- bigreq.h \
- xc_misc.h
EXTSOURCES = xproto.c \
bigreq.c \
xc_misc.c
-EXTENSION_XML = xproto.xml \
- bigreq.xml \
- xc_misc.xml
AM_CFLAGS = $(CWARNFLAGS) $(NEEDED_CFLAGS) $(XDMCP_CFLAGS)
libxcb_la_LIBADD = $(NEEDED_LIBS) $(XDMCP_LIBS)
@@ -30,9 +24,7 @@
# FIXME: find a way to autogenerate this from the XML files.
-EXTHEADERS += composite.h
EXTSOURCES += composite.c
-EXTENSION_XML += composite.xml
if BUILD_COMPOSITE
lib_LTLIBRARIES += libxcb-composite.la
libxcb_composite_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -40,9 +32,7 @@
nodist_libxcb_composite_la_SOURCES = composite.c composite.h
endif
-EXTHEADERS += damage.h
EXTSOURCES += damage.c
-EXTENSION_XML += damage.xml
if BUILD_DAMAGE
lib_LTLIBRARIES += libxcb-damage.la
libxcb_damage_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -50,9 +40,7 @@
nodist_libxcb_damage_la_SOURCES = damage.c damage.h
endif
-EXTHEADERS += dpms.h
EXTSOURCES += dpms.c
-EXTENSION_XML += dpms.xml
if BUILD_DPMS
lib_LTLIBRARIES += libxcb-dpms.la
libxcb_dpms_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -60,9 +48,7 @@
nodist_libxcb_dpms_la_SOURCES = dpms.c dpms.h
endif
-EXTHEADERS += dri2.h
EXTSOURCES += dri2.c
-EXTENSION_XML += dri2.xml
if BUILD_DRI2
lib_LTLIBRARIES += libxcb-dri2.la
libxcb_dri2_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -70,9 +56,7 @@
nodist_libxcb_dri2_la_SOURCES = dri2.c dri2.h
endif
-EXTHEADERS += glx.h
EXTSOURCES += glx.c
-EXTENSION_XML += glx.xml
if BUILD_GLX
lib_LTLIBRARIES += libxcb-glx.la
libxcb_glx_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -80,9 +64,7 @@
nodist_libxcb_glx_la_SOURCES = glx.c glx.h
endif
-EXTHEADERS += randr.h
EXTSOURCES += randr.c
-EXTENSION_XML += randr.xml
if BUILD_RANDR
lib_LTLIBRARIES += libxcb-randr.la
libxcb_randr_la_LDFLAGS = -version-info 1:0:1 -no-undefined
@@ -90,9 +72,7 @@
nodist_libxcb_randr_la_SOURCES = randr.c randr.h
endif
-EXTHEADERS += record.h
EXTSOURCES += record.c
-EXTENSION_XML += record.xml
if BUILD_RECORD
lib_LTLIBRARIES += libxcb-record.la
libxcb_record_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -100,9 +80,7 @@
nodist_libxcb_record_la_SOURCES = record.c record.h
endif
-EXTHEADERS += render.h
EXTSOURCES += render.c
-EXTENSION_XML += render.xml
if BUILD_RENDER
lib_LTLIBRARIES += libxcb-render.la
libxcb_render_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -110,9 +88,7 @@
nodist_libxcb_render_la_SOURCES = render.c render.h
endif
-EXTHEADERS += res.h
EXTSOURCES += res.c
-EXTENSION_XML += res.xml
if BUILD_RESOURCE
lib_LTLIBRARIES += libxcb-res.la
libxcb_res_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -120,9 +96,7 @@
nodist_libxcb_res_la_SOURCES = res.c res.h
endif
-EXTHEADERS += screensaver.h
EXTSOURCES += screensaver.c
-EXTENSION_XML += screensaver.xml
if BUILD_SCREENSAVER
lib_LTLIBRARIES += libxcb-screensaver.la
libxcb_screensaver_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -130,9 +104,7 @@
nodist_libxcb_screensaver_la_SOURCES = screensaver.c screensaver.h
endif
-EXTHEADERS += shape.h
EXTSOURCES += shape.c
-EXTENSION_XML += shape.xml
if BUILD_SHAPE
lib_LTLIBRARIES += libxcb-shape.la
libxcb_shape_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -140,9 +112,7 @@
nodist_libxcb_shape_la_SOURCES = shape.c shape.h
endif
-EXTHEADERS += shm.h
EXTSOURCES += shm.c
-EXTENSION_XML += shm.xml
if BUILD_SHM
lib_LTLIBRARIES += libxcb-shm.la
libxcb_shm_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -150,9 +120,7 @@
nodist_libxcb_shm_la_SOURCES = shm.c shm.h
endif
-EXTHEADERS += sync.h
EXTSOURCES += sync.c
-EXTENSION_XML += sync.xml
if BUILD_SYNC
lib_LTLIBRARIES += libxcb-sync.la
libxcb_sync_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -160,9 +128,7 @@
nodist_libxcb_sync_la_SOURCES = sync.c sync.h
endif
-EXTHEADERS += xevie.h
EXTSOURCES += xevie.c
-EXTENSION_XML += xevie.xml
if BUILD_XEVIE
lib_LTLIBRARIES += libxcb-xevie.la
libxcb_xevie_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -170,9 +136,7 @@
nodist_libxcb_xevie_la_SOURCES = xevie.c xevie.h
endif
-EXTHEADERS += xf86dri.h
EXTSOURCES += xf86dri.c
-EXTENSION_XML += xf86dri.xml
if BUILD_XFREE86_DRI
lib_LTLIBRARIES += libxcb-xf86dri.la
libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -180,9 +144,7 @@
nodist_libxcb_xf86dri_la_SOURCES = xf86dri.c xf86dri.h
endif
-EXTHEADERS += xfixes.h
EXTSOURCES += xfixes.c
-EXTENSION_XML += xfixes.xml
if BUILD_XFIXES
lib_LTLIBRARIES += libxcb-xfixes.la
libxcb_xfixes_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -190,9 +152,7 @@
nodist_libxcb_xfixes_la_SOURCES = xfixes.c xfixes.h
endif
-EXTHEADERS += xinerama.h
EXTSOURCES += xinerama.c
-EXTENSION_XML += xinerama.xml
if BUILD_XINERAMA
lib_LTLIBRARIES += libxcb-xinerama.la
libxcb_xinerama_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -200,9 +160,7 @@
nodist_libxcb_xinerama_la_SOURCES = xinerama.c xinerama.h
endif
-EXTHEADERS += xinput.h
EXTSOURCES += xinput.c
-EXTENSION_XML += xinput.xml
if BUILD_XINPUT
lib_LTLIBRARIES += libxcb-xinput.la
libxcb_xinput_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -210,9 +168,7 @@
nodist_libxcb_xinput_la_SOURCES = xinput.c xinput.h
endif
-EXTHEADERS += xprint.h
EXTSOURCES += xprint.c
-EXTENSION_XML += xprint.xml
if BUILD_XPRINT
lib_LTLIBRARIES += libxcb-xprint.la
libxcb_xprint_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -220,9 +176,7 @@
nodist_libxcb_xprint_la_SOURCES = xprint.c xprint.h
endif
-EXTHEADERS += xselinux.h
EXTSOURCES += xselinux.c
-EXTENSION_XML += xselinux.xml
if BUILD_SELINUX
lib_LTLIBRARIES += libxcb-xselinux.la
libxcb_xselinux_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -230,9 +184,7 @@
nodist_libxcb_xselinux_la_SOURCES = xselinux.c xselinux.h
endif
-EXTHEADERS += xtest.h
EXTSOURCES += xtest.c
-EXTENSION_XML += xtest.xml
if BUILD_XTEST
lib_LTLIBRARIES += libxcb-xtest.la
libxcb_xtest_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -240,9 +192,7 @@
nodist_libxcb_xtest_la_SOURCES = xtest.c xtest.h
endif
-EXTHEADERS += xv.h
EXTSOURCES += xv.c
-EXTENSION_XML += xv.xml
if BUILD_XV
lib_LTLIBRARIES += libxcb-xv.la
libxcb_xv_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -250,9 +200,7 @@
nodist_libxcb_xv_la_SOURCES = xv.c xv.h
endif
-EXTHEADERS += xvmc.h
EXTSOURCES += xvmc.c
-EXTENSION_XML += xvmc.xml
if BUILD_XVMC
lib_LTLIBRARIES += libxcb-xvmc.la
libxcb_xvmc_la_LDFLAGS = -version-info 0:0:0 -no-undefined
@@ -261,23 +209,13 @@
endif
-
+EXTHEADERS=$(EXTSOURCES:.c=.h)
xcbinclude_HEADERS = xcb.h xcbext.h
nodist_xcbinclude_HEADERS = $(EXTHEADERS)
noinst_HEADERS = xcbint.h
-BUILT_SOURCES = $(EXTSOURCES) $(EXTHEADERS)
-CLEANFILES = $(EXTSOURCES) $(EXTHEADERS) $(EXTENSION_XML)
-
-$(EXTHEADERS) $(EXTSOURCES): c_client.py
-
-SUFFIXES = .xml
-
-.xml.h:
- $(PYTHON) $(srcdir)/c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$<
-
-.xml.c:
- $(PYTHON) $(srcdir)/c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$<
+BUILT_SOURCES = $(EXTSOURCES)
+CLEANFILES = $(EXTSOURCES) $(EXTHEADERS)
-$(EXTENSION_XML):
- $(LN_S) -f $(XCBPROTO_XCBINCLUDEDIR)/$@ $@
+$(EXTSOURCES): c_client.py
+ $(PYTHON) $(srcdir)/c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$(@:.c=.xml)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/src/xcb_auth.c new/libxcb-1.7/src/xcb_auth.c
--- old/libxcb-1.5/src/xcb_auth.c 2009-04-21 08:39:35.000000000 +0200
+++ new/libxcb-1.7/src/xcb_auth.c 2010-08-13 13:43:31.000000000 +0200
@@ -89,8 +89,7 @@
#define SIN6_ADDR(s) (&((struct sockaddr_in6 *)s)->sin6_addr)
-static Xauth *get_authptr(struct sockaddr *sockname, unsigned int socknamelen,
- int display)
+static Xauth *get_authptr(struct sockaddr *sockname, int display)
{
char *addr = 0;
int addrlen = 0;
@@ -243,13 +242,55 @@
return 0; /* Unknown authorization type */
}
+/* `sockaddr_un.sun_path' typical size usually ranges between 92 and 108 */
+#define INITIAL_SOCKNAME_SLACK 108
+
+/* Return a dynamically allocated socket address structure according
+ to the value returned by either getpeername() or getsockname()
+ (according to POSIX, applications should not assume a particular
+ length for `sockaddr_un.sun_path') */
+static struct sockaddr *get_peer_sock_name(int (*socket_func)(int,
+ struct sockaddr *,
+ socklen_t *),
+ int fd)
+{
+ socklen_t socknamelen = sizeof(struct sockaddr) + INITIAL_SOCKNAME_SLACK;
+ socklen_t actual_socknamelen = socknamelen;
+ struct sockaddr *sockname = malloc(socknamelen), *new_sockname = NULL;
+
+ if (sockname == NULL)
+ return NULL;
+
+ /* Both getpeername() and getsockname() truncates sockname if
+ there is not enough space and set the required length in
+ actual_socknamelen */
+ if (socket_func(fd, sockname, &actual_socknamelen) == -1)
+ goto sock_or_realloc_error;
+
+ if (actual_socknamelen > socknamelen)
+ {
+ socknamelen = actual_socknamelen;
+
+ if ((new_sockname = realloc(sockname, actual_socknamelen)) == NULL ||
+ socket_func(fd, new_sockname, &actual_socknamelen) == -1 ||
+ actual_socknamelen > socknamelen)
+ goto sock_or_realloc_error;
+
+ sockname = new_sockname;
+ }
+
+ return sockname;
+
+ sock_or_realloc_error:
+ free(sockname);
+ return NULL;
+}
+
int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display)
{
/* code adapted from Xlib/ConnDis.c, xtrans/Xtranssocket.c,
xtrans/Xtransutils.c */
- char sockbuf[sizeof(struct sockaddr) + MAXPATHLEN];
- unsigned int socknamelen = sizeof(sockbuf); /* need extra space */
- struct sockaddr *sockname = (struct sockaddr *) &sockbuf;
+ struct sockaddr *sockname = NULL;
int gotsockname = 0;
Xauth *authptr = 0;
int ret = 1;
@@ -258,24 +299,30 @@
* for UNIX Domain Sockets, but this is irrelevant,
* since compute_auth() ignores the peer name in this
* case anyway.*/
- if (getpeername(fd, sockname, &socknamelen) == -1)
+ if ((sockname = get_peer_sock_name(getpeername, fd)) == NULL)
{
+ if ((sockname = get_peer_sock_name(getsockname, fd)) == NULL)
+ return 0; /* can only authenticate sockets */
if (sockname->sa_family != AF_UNIX)
+ {
+ free(sockname);
return 0; /* except for AF_UNIX, sockets should have peernames */
- if (getsockname(fd, sockname, &socknamelen) == -1)
- return 0; /* can only authenticate sockets */
+ }
gotsockname = 1;
}
- authptr = get_authptr(sockname, socknamelen, display);
+ authptr = get_authptr(sockname, display);
if (authptr == 0)
+ {
+ free(sockname);
return 0; /* cannot find good auth data */
+ }
info->namelen = memdup(&info->name, authptr->name, authptr->name_length);
if (!info->namelen)
goto no_auth; /* out of memory */
- if (!gotsockname && getsockname(fd, sockname, &socknamelen) == -1)
+ if (!gotsockname && (sockname = get_peer_sock_name(getsockname, fd)) == NULL)
{
free(info->name);
goto no_auth; /* can only authenticate sockets */
@@ -288,10 +335,15 @@
goto no_auth; /* cannot build auth record */
}
+ free(sockname);
+ sockname = NULL;
+
XauDisposeAuth(authptr);
return ret;
no_auth:
+ free(sockname);
+
info->name = 0;
info->namelen = 0;
XauDisposeAuth(authptr);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/src/xcb_conn.c new/libxcb-1.7/src/xcb_conn.c
--- old/libxcb-1.5/src/xcb_conn.c 2009-04-06 10:47:58.000000000 +0200
+++ new/libxcb-1.7/src/xcb_conn.c 2010-08-13 13:43:31.000000000 +0200
@@ -102,10 +102,7 @@
assert(count <= (int) (sizeof(parts) / sizeof(*parts)));
pthread_mutex_lock(&c->iolock);
- {
- struct iovec *parts_ptr = parts;
- ret = _xcb_out_send(c, &parts_ptr, &count);
- }
+ ret = _xcb_out_send(c, parts, count);
pthread_mutex_unlock(&c->iolock);
return ret;
}
@@ -210,9 +207,19 @@
{
xcb_connection_t* c;
+#ifndef USE_POLL
+ if(fd >= FD_SETSIZE) /* would overflow in FD_SET */
+ {
+ close(fd);
+ return (xcb_connection_t *) &error_connection;
+ }
+#endif
+
c = calloc(1, sizeof(xcb_connection_t));
- if(!c)
+ if(!c) {
+ close(fd);
return (xcb_connection_t *) &error_connection;
+ }
c->fd = fd;
@@ -303,15 +310,15 @@
pthread_mutex_unlock(&c->iolock);
do {
#if USE_POLL
- ret = poll(&fd, 1, -1);
+ ret = poll(&fd, 1, -1);
#else
- ret = select(c->fd + 1, &rfds, &wfds, 0, 0);
+ ret = select(c->fd + 1, &rfds, &wfds, 0, 0);
#endif
} while (ret == -1 && errno == EINTR);
- if (ret < 0)
+ if(ret < 0)
{
_xcb_conn_shutdown(c);
- ret = 0;
+ ret = 0;
}
pthread_mutex_lock(&c->iolock);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/src/xcb.h new/libxcb-1.7/src/xcb.h
--- old/libxcb-1.5/src/xcb.h 2009-12-03 10:05:11.000000000 +0100
+++ new/libxcb-1.7/src/xcb.h 2010-02-17 10:08:42.000000000 +0100
@@ -285,6 +285,22 @@
*/
xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie);
+/**
+ * @brief Discards the reply for a request.
+ * @param c: The connection to the X server.
+ * @param sequence: The request sequence number from a cookie.
+ *
+ * Discards the reply for a request. Additionally, any error generated
+ * by the request is also discarded (unless it was an _unchecked request
+ * and the error has already arrived).
+ *
+ * This function will not block even if the reply is not yet available.
+ *
+ * Note that the sequence really does have to come from an xcb cookie;
+ * this function is not designed to operate on socket-handoff replies.
+ */
+void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence);
+
/* xcb_ext.c */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/src/xcb_in.c new/libxcb-1.7/src/xcb_in.c
--- old/libxcb-1.5/src/xcb_in.c 2009-04-06 10:47:58.000000000 +0200
+++ new/libxcb-1.7/src/xcb_in.c 2010-08-13 13:43:31.000000000 +0200
@@ -69,16 +69,6 @@
struct reader_list *next;
} reader_list;
-static void wake_up_next_reader(xcb_connection_t *c)
-{
- int pthreadret;
- if(c->in.readers)
- pthreadret = pthread_cond_signal(c->in.readers->data);
- else
- pthreadret = pthread_cond_signal(&c->in.event_cond);
- assert(pthreadret == 0);
-}
-
static int read_packet(xcb_connection_t *c)
{
xcb_generic_reply_t genrep;
@@ -154,9 +144,7 @@
/* XGE events may have sizes > 32 */
if (genrep.response_type == XCB_XGE_EVENT)
- {
- eventlength = ((xcb_ge_event_t*)&genrep)->length * 4;
- }
+ eventlength = genrep.length * 4;
buf = malloc(length + eventlength +
(genrep.response_type == XCB_REPLY ? 0 : sizeof(uint32_t)));
@@ -404,11 +392,121 @@
pthread_cond_destroy(&cond);
}
- wake_up_next_reader(c);
+ _xcb_in_wake_up_next_reader(c);
pthread_mutex_unlock(&c->iolock);
return ret;
}
+static void insert_pending_discard(xcb_connection_t *c, pending_reply **prev_next, uint64_t seq)
+{
+ pending_reply *pend;
+ pend = malloc(sizeof(*pend));
+ if(!pend)
+ {
+ _xcb_conn_shutdown(c);
+ return;
+ }
+
+ pend->first_request = seq;
+ pend->last_request = seq;
+ pend->workaround = 0;
+ pend->flags = XCB_REQUEST_DISCARD_REPLY;
+ pend->next = *prev_next;
+ *prev_next = pend;
+
+ if(!pend->next)
+ c->in.pending_replies_tail = &pend->next;
+}
+
+static void discard_reply(xcb_connection_t *c, unsigned int request)
+{
+ pending_reply *pend = 0;
+ pending_reply **prev_pend;
+ uint64_t widened_request;
+
+ /* We've read requests past the one we want, so if it has replies we have
+ * them all and they're in the replies map. */
+ if(XCB_SEQUENCE_COMPARE_32(request, <, c->in.request_read))
+ {
+ struct reply_list *head;
+ head = _xcb_map_remove(c->in.replies, request);
+ while (head)
+ {
+ struct reply_list *next = head->next;
+ free(head->reply);
+ free(head);
+ head = next;
+ }
+ return;
+ }
+
+ /* We're currently processing the responses to the request we want, and we
+ * have a reply ready to return. Free it, and mark the pend to free any further
+ * replies. */
+ if(XCB_SEQUENCE_COMPARE_32(request, ==, c->in.request_read) && c->in.current_reply)
+ {
+ struct reply_list *head;
+ head = c->in.current_reply;
+ c->in.current_reply = NULL;
+ c->in.current_reply_tail = &c->in.current_reply;
+ while (head)
+ {
+ struct reply_list *next = head->next;
+ free(head->reply);
+ free(head);
+ head = next;
+ }
+
+ pend = c->in.pending_replies;
+ if(pend &&
+ !(XCB_SEQUENCE_COMPARE(pend->first_request, <=, c->in.request_read) &&
+ (pend->workaround == WORKAROUND_EXTERNAL_SOCKET_OWNER ||
+ XCB_SEQUENCE_COMPARE(c->in.request_read, <=, pend->last_request))))
+ pend = 0;
+ if(pend)
+ pend->flags |= XCB_REQUEST_DISCARD_REPLY;
+ else
+ insert_pending_discard(c, &c->in.pending_replies, c->in.request_read);
+
+ return;
+ }
+
+ /* Walk the list of pending requests. Mark the first match for deletion. */
+ for(prev_pend = &c->in.pending_replies; *prev_pend; prev_pend = &(*prev_pend)->next)
+ {
+ if(XCB_SEQUENCE_COMPARE_32((*prev_pend)->first_request, >, request))
+ break;
+
+ if(XCB_SEQUENCE_COMPARE_32((*prev_pend)->first_request, ==, request))
+ {
+ /* Pending reply found. Mark for discard: */
+ (*prev_pend)->flags |= XCB_REQUEST_DISCARD_REPLY;
+ return;
+ }
+ }
+
+ /* Pending reply not found (likely due to _unchecked request). Create one: */
+ widened_request = (c->out.request & UINT64_C(0xffffffff00000000)) | request;
+ if(widened_request > c->out.request)
+ widened_request -= UINT64_C(1) << 32;
+
+ insert_pending_discard(c, prev_pend, widened_request);
+}
+
+void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence)
+{
+ if(c->has_error)
+ return;
+
+ /* If an error occurred when issuing the request, fail immediately. */
+ if(!sequence)
+ return;
+
+ pthread_mutex_lock(&c->iolock);
+ discard_reply(c, sequence);
+ pthread_mutex_unlock(&c->iolock);
+}
+
int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply, xcb_generic_error_t **error)
{
int ret;
@@ -437,7 +535,7 @@
if(!_xcb_conn_wait(c, &c->in.event_cond, 0, 0))
break;
- wake_up_next_reader(c);
+ _xcb_in_wake_up_next_reader(c);
pthread_mutex_unlock(&c->iolock);
return ret;
}
@@ -521,6 +619,16 @@
}
}
+void _xcb_in_wake_up_next_reader(xcb_connection_t *c)
+{
+ int pthreadret;
+ if(c->in.readers)
+ pthreadret = pthread_cond_signal(c->in.readers->data);
+ else
+ pthreadret = pthread_cond_signal(&c->in.event_cond);
+ assert(pthreadret == 0);
+}
+
int _xcb_in_expect_reply(xcb_connection_t *c, uint64_t request, enum workarounds workaround, int flags)
{
pending_reply *pend = malloc(sizeof(pending_reply));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/src/xcbint.h new/libxcb-1.7/src/xcbint.h
--- old/libxcb-1.5/src/xcbint.h 2009-04-11 16:31:18.000000000 +0200
+++ new/libxcb-1.7/src/xcbint.h 2010-08-13 13:43:31.000000000 +0200
@@ -106,7 +106,7 @@
int _xcb_out_init(_xcb_out *out);
void _xcb_out_destroy(_xcb_out *out);
-int _xcb_out_send(xcb_connection_t *c, struct iovec **vector, int *count);
+int _xcb_out_send(xcb_connection_t *c, struct iovec *vector, int count);
int _xcb_out_flush_to(xcb_connection_t *c, uint64_t request);
@@ -137,6 +137,8 @@
int _xcb_in_init(_xcb_in *in);
void _xcb_in_destroy(_xcb_in *in);
+void _xcb_in_wake_up_next_reader(xcb_connection_t *c);
+
int _xcb_in_expect_reply(xcb_connection_t *c, uint64_t request, enum workarounds workaround, int flags);
void _xcb_in_replies_done(xcb_connection_t *c);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/src/xcb_out.c new/libxcb-1.7/src/xcb_out.c
--- old/libxcb-1.5/src/xcb_out.c 2009-08-16 11:02:47.000000000 +0200
+++ new/libxcb-1.7/src/xcb_out.c 2010-08-13 13:43:31.000000000 +0200
@@ -52,7 +52,7 @@
vector[0].iov_base = c->out.queue;
vector[0].iov_len = c->out.queue_len;
c->out.queue_len = 0;
- return _xcb_out_send(c, &vector, &count);
+ return _xcb_out_send(c, vector, count);
}
static void get_socket_back(xcb_connection_t *c)
@@ -283,7 +283,7 @@
return 0;
pthread_mutex_lock(&c->iolock);
c->out.request += requests;
- ret = _xcb_out_send(c, &vector, &count);
+ ret = _xcb_out_send(c, vector, count);
pthread_mutex_unlock(&c->iolock);
return ret;
}
@@ -331,13 +331,14 @@
pthread_mutex_destroy(&out->reqlenlock);
}
-int _xcb_out_send(xcb_connection_t *c, struct iovec **vector, int *count)
+int _xcb_out_send(xcb_connection_t *c, struct iovec *vector, int count)
{
int ret = 1;
- while(ret && *count)
- ret = _xcb_conn_wait(c, &c->out.cond, vector, count);
+ while(ret && count)
+ ret = _xcb_conn_wait(c, &c->out.cond, &vector, &count);
c->out.request_written = c->out.request;
pthread_cond_broadcast(&c->out.cond);
+ _xcb_in_wake_up_next_reader(c);
return ret;
}
@@ -348,12 +349,11 @@
return 1;
if(c->out.queue_len)
{
- struct iovec vec, *vec_ptr = &vec;
- int count = 1;
+ struct iovec vec;
vec.iov_base = c->out.queue;
vec.iov_len = c->out.queue_len;
c->out.queue_len = 0;
- return _xcb_out_send(c, &vec_ptr, &count);
+ return _xcb_out_send(c, &vec, 1);
}
while(c->out.writing)
pthread_cond_wait(&c->out.cond, &c->iolock);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/libxcb-1.5/src/xcb_util.c new/libxcb-1.7/src/xcb_util.c
--- old/libxcb-1.5/src/xcb_util.c 2009-12-03 10:04:23.000000000 +0100
+++ new/libxcb-1.7/src/xcb_util.c 2010-08-13 13:43:31.000000000 +0200
@@ -28,6 +28,7 @@
#include