summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChí-Thanh Christopher Nguyễn <chithanh@gentoo.org>2012-03-03 12:19:25 +0000
committerChí-Thanh Christopher Nguyễn <chithanh@gentoo.org>2012-03-03 12:19:25 +0000
commite908a97e62746920ff24c048ae808a444cdfa2c6 (patch)
tree664dc28c46070026ef66a6d98980e6658200dc7f /x11-libs/libxcb/files
parentRun java-pkg-opt-2_pkg_setup to use jdk when compiling, bug #401803 by DrSlon... (diff)
downloadhistorical-e908a97e62746920ff24c048ae808a444cdfa2c6.tar.gz
historical-e908a97e62746920ff24c048ae808a444cdfa2c6.tar.bz2
historical-e908a97e62746920ff24c048ae808a444cdfa2c6.zip
Add patch to fix hang on BSD and OS X, bug #405951.
Package-Manager: portage-2.2.0_alpha89/cvs/Linux x86_64
Diffstat (limited to 'x11-libs/libxcb/files')
-rw-r--r--x11-libs/libxcb/files/libxcb-1.8-waitall-hang.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/x11-libs/libxcb/files/libxcb-1.8-waitall-hang.patch b/x11-libs/libxcb/files/libxcb-1.8-waitall-hang.patch
new file mode 100644
index 000000000000..ef929cf2c67c
--- /dev/null
+++ b/x11-libs/libxcb/files/libxcb-1.8-waitall-hang.patch
@@ -0,0 +1,54 @@
+From 2b5bc1d3299510e10a1733e5a3b326232c774b75 Mon Sep 17 00:00:00 2001
+From: Julien Cristau <jcristau@debian.org>
+Date: Thu, 9 Feb 2012 23:54:55 +0100
+Subject: [PATCH] Stop using recv(MSG_WAITALL)
+
+In one case we don't actually want to fill up our buffer. In the other
+one we're looping over the recv() until we have all the data.
+
+Debian bug#659104
+
+Reported-by: Christoph Egger <christoph@debian.org>
+Signed-off-by: Julien Cristau <jcristau@debian.org>
+---
+ src/xcb_in.c | 10 +++-------
+ 1 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/src/xcb_in.c b/src/xcb_in.c
+index 969cfc0..4d8d691 100644
+--- a/src/xcb_in.c
++++ b/src/xcb_in.c
+@@ -51,11 +51,6 @@
+ #define XCB_REPLY 1
+ #define XCB_XGE_EVENT 35
+
+-/* required for compiling for Win32 using MinGW */
+-#ifndef MSG_WAITALL
+-#define MSG_WAITALL 0
+-#endif
+-
+ struct event_list {
+ xcb_generic_event_t *event;
+ struct event_list *next;
+@@ -269,7 +264,7 @@ static int read_block(const int fd, void *buf, const ssize_t len)
+ int done = 0;
+ while(done < len)
+ {
+- int ret = recv(fd, ((char *) buf) + done, len - done,MSG_WAITALL);
++ int ret = recv(fd, ((char *) buf) + done, len - done, 0);
+ if(ret > 0)
+ done += ret;
+ #ifndef _WIN32
+@@ -661,7 +656,8 @@ void _xcb_in_replies_done(xcb_connection_t *c)
+
+ int _xcb_in_read(xcb_connection_t *c)
+ {
+- int n = recv(c->fd, c->in.queue + c->in.queue_len, sizeof(c->in.queue) - c->in.queue_len,MSG_WAITALL);
++ int n = recv(c->fd, c->in.queue + c->in.queue_len,
++ sizeof(c->in.queue) - c->in.queue_len, 0);
+ if(n > 0)
+ c->in.queue_len += n;
+ while(read_packet(c))
+--
+1.7.2.5
+