Index: ports/libxcb/nacl.patch |
diff --git a/ports/libxcb/nacl.patch b/ports/libxcb/nacl.patch |
index 5d72c02fcb0b530b32e0c483947f6c6f72a24c20..64fbddc34a983c003e75e481621e1a8861124337 100644 |
--- a/ports/libxcb/nacl.patch |
+++ b/ports/libxcb/nacl.patch |
@@ -1,7 +1,7 @@ |
diff --git a/configure b/configure |
--- a/configure |
+++ b/configure |
-@@ -13123,7 +13123,9 @@ else |
+@@ -13123,7 +13136,9 @@ else |
$as_echo "yes" >&6; } |
fi |
@@ -42,41 +42,3 @@ diff --git a/src/xcb_conn.c b/src/xcb_conn.c |
static int set_fd_flags(const int fd) |
{ |
/* Win32 doesn't have file descriptors and the fcntl function. This block sets the socket in non-blocking mode */ |
-@@ -179,7 +199,8 @@ static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count) |
- int n; |
- assert(!c->out.queue_len); |
- |
--#ifdef _WIN32 |
-+ /* Using writev emulation for nacl newlib. */ |
-+#if defined(_WIN32) || (defined(__native_client__) && defined(_NEWLIB_VERSION)) |
- int i = 0; |
- int ret = 0,err = 0; |
- struct iovec *vec; |
-@@ -190,11 +211,26 @@ static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count) |
- vec = *vector; |
- while(i < *count) |
- { |
-- ret = send(c->fd,vec->iov_base,vec->iov_len,0); |
-+ /* |
-+ * TODO(bradnelson): Drop if nacl_io supports zero length sends. |
-+ * https://code.google.com/p/naclports/issues/detail?id=228 |
-+ */ |
-+ if (vec->iov_len != 0) { |
-+ ret = send(c->fd,vec->iov_base,vec->iov_len,0); |
-+ } else { |
-+ ret = 0; |
-+ } |
-+ /* Generalize to posix so this can be used with nacl newlib. */ |
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION) |
-+ if(ret < 0) |
-+ { |
-+ if(errno == EWOULDBLOCK) |
-+#else |
- if(ret == SOCKET_ERROR) |
- { |
- err = WSAGetLastError(); |
- if(err == WSAEWOULDBLOCK) |
-+#endif |
- { |
- return 1; |
- } |