diff --git a/dist/libxcb/Makefile.am b/dist/libxcb/Makefile.am
index 3a2f6f554..ff9dea1cc 100644
--- a/dist/libxcb/Makefile.am
+++ b/dist/libxcb/Makefile.am
@@ -13,6 +13,9 @@ endif
if BUILD_DPMS
pkgconfig_DATA += xcb-dpms.pc
endif
+if BUILD_DRI2
+pkgconfig_DATA += xcb-dri2.pc
+endif
if BUILD_GLX
pkgconfig_DATA += xcb-glx.pc
endif
diff --git a/dist/libxcb/NEWS b/dist/libxcb/NEWS
index af173eb28..457059877 100644
--- a/dist/libxcb/NEWS
+++ b/dist/libxcb/NEWS
@@ -1,3 +1,18 @@
+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
+- Add DRI2 support
+- Fix check dependency
+- Cygwin build fix: Add -no-undefined to libtool flags
+
Release 1.4 (2009-07-15)
========================
* Add majorCode, minorCode and resourceID fields to X generic error
diff --git a/dist/libxcb/acinclude.m4 b/dist/libxcb/acinclude.m4
index bc981504c..ad24bc2e5 100644
--- a/dist/libxcb/acinclude.m4
+++ b/dist/libxcb/acinclude.m4
@@ -102,6 +102,11 @@ AC_ARG_WITH(
AC_MSG_WARN(
[Warning: no doxygen detected. Documentation will not be built])
fi])
+ AC_PATH_PROG(DOT, dot, no)
+ if test "$DOT" = "no"; then
+ AC_MSG_WARN([Warning: no dot detected. Documentation will not be built])
+ BUILD_DOCS="no"
+ fi
fi
AC_MSG_CHECKING([whether documentation is built])
AC_MSG_RESULT([${BUILD_DOCS}])
diff --git a/dist/libxcb/configure.ac b/dist/libxcb/configure.ac
index 96f507903..c5f454bee 100644
--- a/dist/libxcb/configure.ac
+++ b/dist/libxcb/configure.ac
@@ -3,7 +3,7 @@
AC_PREREQ(2.57)
AC_INIT([libxcb],
- 1.4,
+ 1.6,
[xcb@lists.freedesktop.org])
AC_CONFIG_SRCDIR([xcb.pc.in])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -32,7 +32,7 @@ fi
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 @@ AC_PREREQ([2.59c], [], [AC_SUBST([htmldir], [m4_ifset([AC_PACKAGE_TARNAME],
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])], )
;;
@@ -132,6 +131,7 @@ esac
XCB_EXTENSION(Composite, "yes")
XCB_EXTENSION(Damage, "yes")
XCB_EXTENSION(DPMS, "yes")
+XCB_EXTENSION(DRI2, "yes")
XCB_EXTENSION(GLX, "yes")
XCB_EXTENSION(RandR, "yes")
XCB_EXTENSION(Record, "yes")
@@ -174,6 +174,7 @@ xcb.pc
xcb-composite.pc
xcb-damage.pc
xcb-dpms.pc
+xcb-dri2.pc
xcb-glx.pc
xcb-randr.pc
xcb-record.pc
diff --git a/dist/libxcb/doc/tutorial/index.html b/dist/libxcb/doc/tutorial/index.html
index c5404263f..aa3ae1706 100644
--- a/dist/libxcb/doc/tutorial/index.html
+++ b/dist/libxcb/doc/tutorial/index.html
@@ -173,7 +173,7 @@
with the XCB
library. keep in mind that XCB, like the
Xlib
- library, isn't what post programmers wanting to write X
+ library, isn't what most programmers wanting to write X
applications are looking for. They should use a much higher
level GUI toolkit like Motif,
LessTiff,
@@ -471,8 +471,6 @@ main ()
diff = end - start;
/* free var */
- for (i = 0; i < count; ++i)
- free (names[i]);
free (atoms);
free (cs);
@@ -494,6 +492,8 @@ main ()
printf ("ratio : %f\n", diff_x / diff);
free (atoms_x);
+ for (i = 0; i < count; ++i)
+ free (names[i]);
free (names);
XCloseDisplay (disp);
diff --git a/dist/libxcb/src/Makefile.am b/dist/libxcb/src/Makefile.am
index 5de3b09f3..f0bdeaa46 100644
--- a/dist/libxcb/src/Makefile.am
+++ b/dist/libxcb/src/Makefile.am
@@ -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)
@@ -24,250 +18,204 @@ nodist_libxcb_la_SOURCES = xproto.c bigreq.c xc_misc.c
# * If you add an interface, increment current and age and set revision to 0.
# * If you change or remove an interface, increment current and set revision
# and age to 0.
-libxcb_la_LDFLAGS = -version-info 2:0:1
+libxcb_la_LDFLAGS = -version-info 2:0:1 -no-undefined
XCB_LIBS = libxcb.la
# 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
+libxcb_composite_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_composite_la_LIBADD = $(XCB_LIBS)
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
+libxcb_damage_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_damage_la_LIBADD = $(XCB_LIBS)
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
+libxcb_dpms_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_dpms_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_dpms_la_SOURCES = dpms.c dpms.h
endif
-EXTHEADERS += glx.h
+EXTSOURCES += dri2.c
+if BUILD_DRI2
+lib_LTLIBRARIES += libxcb-dri2.la
+libxcb_dri2_la_LDFLAGS = -version-info 0:0:0 -no-undefined
+libxcb_dri2_la_LIBADD = $(XCB_LIBS)
+nodist_libxcb_dri2_la_SOURCES = dri2.c dri2.h
+endif
+
EXTSOURCES += glx.c
-EXTENSION_XML += glx.xml
if BUILD_GLX
lib_LTLIBRARIES += libxcb-glx.la
-libxcb_glx_la_LDFLAGS = -version-info 0:0:0
+libxcb_glx_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_glx_la_LIBADD = $(XCB_LIBS)
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
+libxcb_randr_la_LDFLAGS = -version-info 1:0:1 -no-undefined
libxcb_randr_la_LIBADD = $(XCB_LIBS)
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
+libxcb_record_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_record_la_LIBADD = $(XCB_LIBS)
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
+libxcb_render_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_render_la_LIBADD = $(XCB_LIBS)
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
+libxcb_res_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_res_la_LIBADD = $(XCB_LIBS)
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
+libxcb_screensaver_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_screensaver_la_LIBADD = $(XCB_LIBS)
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
+libxcb_shape_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_shape_la_LIBADD = $(XCB_LIBS)
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
+libxcb_shm_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_shm_la_LIBADD = $(XCB_LIBS)
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
+libxcb_sync_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_sync_la_LIBADD = $(XCB_LIBS)
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
+libxcb_xevie_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_xevie_la_LIBADD = $(XCB_LIBS)
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
+libxcb_xf86dri_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_xf86dri_la_LIBADD = $(XCB_LIBS)
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
+libxcb_xfixes_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_xfixes_la_LIBADD = $(XCB_LIBS)
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
+libxcb_xinerama_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_xinerama_la_LIBADD = $(XCB_LIBS)
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
+libxcb_xinput_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_xinput_la_LIBADD = $(XCB_LIBS)
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
+libxcb_xprint_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_xprint_la_LIBADD = $(XCB_LIBS)
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
+libxcb_xselinux_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_xselinux_la_LIBADD = $(XCB_LIBS)
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
+libxcb_xtest_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_xtest_la_LIBADD = $(XCB_LIBS)
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
+libxcb_xv_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_xv_la_LIBADD = $(XCB_LIBS)
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
+libxcb_xvmc_la_LDFLAGS = -version-info 0:0:0 -no-undefined
libxcb_xvmc_la_LIBADD = $(XCB_LIBS)
nodist_libxcb_xvmc_la_SOURCES = xvmc.c xvmc.h
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)
+BUILT_SOURCES = $(EXTSOURCES)
+CLEANFILES = $(EXTSOURCES) $(EXTHEADERS)
-$(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)/$<
-
-$(EXTENSION_XML):
- $(LN_S) -f $(XCBPROTO_XCBINCLUDEDIR)/$@ $@
+$(EXTSOURCES): c_client.py
+ $(PYTHON) $(srcdir)/c_client.py -p $(XCBPROTO_XCBPYTHONDIR) $(XCBPROTO_XCBINCLUDEDIR)/$(@:.c=.xml)
diff --git a/dist/libxcb/src/xcb.h b/dist/libxcb/src/xcb.h
index f95127665..35d876883 100644
--- a/dist/libxcb/src/xcb.h
+++ b/dist/libxcb/src/xcb.h
@@ -285,6 +285,22 @@ xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c);
*/
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 --git a/dist/libxcb/src/xcb_auth.c b/dist/libxcb/src/xcb_auth.c
index 104f2f07b..00aad23c5 100644
--- a/dist/libxcb/src/xcb_auth.c
+++ b/dist/libxcb/src/xcb_auth.c
@@ -260,10 +260,10 @@ int _xcb_get_auth_info(int fd, xcb_auth_info_t *info, int display)
* case anyway.*/
if (getpeername(fd, sockname, &socknamelen) == -1)
{
- if (sockname->sa_family != AF_UNIX)
- return 0; /* except for AF_UNIX, sockets should have peernames */
if (getsockname(fd, sockname, &socknamelen) == -1)
return 0; /* can only authenticate sockets */
+ if (sockname->sa_family != AF_UNIX)
+ return 0; /* except for AF_UNIX, sockets should have peernames */
gotsockname = 1;
}
diff --git a/dist/libxcb/src/xcb_conn.c b/dist/libxcb/src/xcb_conn.c
index 251d62e01..1d3761452 100644
--- a/dist/libxcb/src/xcb_conn.c
+++ b/dist/libxcb/src/xcb_conn.c
@@ -210,9 +210,19 @@ xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info)
{
xcb_connection_t* c;
- c = calloc(1, sizeof(xcb_connection_t));
- if(!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) {
+ close(fd);
+ return (xcb_connection_t *) &error_connection;
+ }
c->fd = fd;
diff --git a/dist/libxcb/src/xcb_in.c b/dist/libxcb/src/xcb_in.c
index 26ab3581f..80f55232e 100644
--- a/dist/libxcb/src/xcb_in.c
+++ b/dist/libxcb/src/xcb_in.c
@@ -409,6 +409,116 @@ void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_
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;
diff --git a/dist/libxcb/src/xcb_util.c b/dist/libxcb/src/xcb_util.c
index 55aadb7ca..996ff2518 100644
--- a/dist/libxcb/src/xcb_util.c
+++ b/dist/libxcb/src/xcb_util.c
@@ -41,6 +41,7 @@
#include
#include
#include
+#include
#include
#include "xcb.h"
@@ -177,6 +178,22 @@ static int _xcb_open(char *host, char *protocol, const int display)
return _xcb_open_unix(protocol, file);
}
+static int _xcb_socket(int family, int type, int proto)
+{
+ int fd;
+
+#ifdef SOCK_CLOEXEC
+ fd = socket(family, type | SOCK_CLOEXEC, proto);
+ if (fd == -1 && errno == EINVAL)
+#endif
+ {
+ fd = socket(family, type, proto);
+ if (fd >= 0)
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+ }
+ return fd;
+}
+
#ifdef DNETCONN
static int _xcb_open_decnet(const char *host, const char *protocol, const unsigned short port)
{
@@ -199,7 +216,7 @@ static int _xcb_open_decnet(const char *host, const char *protocol, const unsign
return -1;
addr.sdn_objnum = 0;
- fd = socket(PF_DECnet, SOCK_STREAM, 0);
+ fd = _xcb_socket(PF_DECnet, SOCK_STREAM, 0);
if(fd == -1)
return -1;
@@ -256,10 +273,11 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port)
for(addr = results; addr; addr = addr->ai_next)
{
- fd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
+ fd = _xcb_socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
if(fd >= 0) {
int on = 1;
setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+ setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on));
if (connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0)
break;
@@ -284,7 +302,7 @@ static int _xcb_open_unix(char *protocol, const char *file)
#ifdef HAVE_SOCKADDR_SUN_LEN
addr.sun_len = SUN_LEN(&addr);
#endif
- fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ fd = _xcb_socket(AF_UNIX, SOCK_STREAM, 0);
if(fd == -1)
return -1;
if(connect(fd, (struct sockaddr *) &addr, sizeof(addr)) == -1) {
@@ -310,7 +328,7 @@ static int _xcb_open_abstract(char *protocol, const char *file, size_t filelen)
#ifdef HAVE_SOCKADDR_SUN_LEN
addr.sun_len = 1 + filelen;
#endif
- fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ fd = _xcb_socket(AF_UNIX, SOCK_STREAM, 0);
if (fd == -1)
return -1;
if (connect(fd, (struct sockaddr *) &addr, namelen) == -1) {
diff --git a/dist/libxcb/tests/Makefile.am b/dist/libxcb/tests/Makefile.am
index 77593f0b7..077681e51 100644
--- a/dist/libxcb/tests/Makefile.am
+++ b/dist/libxcb/tests/Makefile.am
@@ -15,7 +15,7 @@ check_all_SOURCES = check_all.c check_suites.h check_public.c
all-local::
$(RM) CheckLog*.xml
-check-local:
+check-local: check-TESTS
$(RM) CheckLog.html
if test x$(HTML_CHECK_RESULT) = xtrue; then \
$(XSLTPROC) $(srcdir)/CheckLog.xsl CheckLog*.xml > CheckLog.html; \
diff --git a/dist/libxcb/xcb-dri2.pc.in b/dist/libxcb/xcb-dri2.pc.in
new file mode 100644
index 000000000..a9944dfa2
--- /dev/null
+++ b/dist/libxcb/xcb-dri2.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: XCB DRI2
+Description: XCB DRI2 Extension
+Version: @PACKAGE_VERSION@
+Requires: xcb
+Libs: -L${libdir} -lxcb-dri2
+Cflags: -I${includedir}
diff --git a/lib/libxcb/Makefile b/lib/libxcb/Makefile
index 244de6086..f7c877b5a 100644
--- a/lib/libxcb/Makefile
+++ b/lib/libxcb/Makefile
@@ -1,10 +1,11 @@
-# $OpenBSD: Makefile,v 1.2 2009/05/23 15:08:50 matthieu Exp $
+# $OpenBSD: Makefile,v 1.3 2010/04/18 20:06:18 matthieu Exp $
SUBDIR=\
libxcb \
libxcb-composite \
libxcb-damage \
libxcb-dpms \
+ libxcb-dri2 \
libxcb-glx \
libxcb-randr \
libxcb-record \
diff --git a/lib/libxcb/libxcb-dri2/Makefile b/lib/libxcb/libxcb-dri2/Makefile
new file mode 100644
index 000000000..8fdd61b3e
--- /dev/null
+++ b/lib/libxcb/libxcb-dri2/Makefile
@@ -0,0 +1,12 @@
+# $OpenBSD: Makefile,v 1.1 2010/04/18 20:06:18 matthieu Exp $
+
+LIB= xcb-dri2
+
+HEADERS= dri2.h
+
+SRCS= dri2.c
+
+PKGCONFIG= xcb-dri2.pc
+
+.include
+.include
diff --git a/lib/libxcb/libxcb-dri2/shlib_version b/lib/libxcb/libxcb-dri2/shlib_version
new file mode 100644
index 000000000..97c9f92d6
--- /dev/null
+++ b/lib/libxcb/libxcb-dri2/shlib_version
@@ -0,0 +1,2 @@
+major=0
+minor=0
diff --git a/lib/libxcb/libxcb-xf86dri/shlib_version b/lib/libxcb/libxcb-xf86dri/shlib_version
index 97c9f92d6..1edea46de 100644
--- a/lib/libxcb/libxcb-xf86dri/shlib_version
+++ b/lib/libxcb/libxcb-xf86dri/shlib_version
@@ -1,2 +1,2 @@
-major=0
+major=1
minor=0
diff --git a/lib/libxcb/libxcb/shlib_version b/lib/libxcb/libxcb/shlib_version
index b52599a16..c6e3f4d3f 100644
--- a/lib/libxcb/libxcb/shlib_version
+++ b/lib/libxcb/libxcb/shlib_version
@@ -1,2 +1,2 @@
major=2
-minor=0
+minor=1