aboutsummaryrefslogtreecommitdiff
path: root/libxcb
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-09-20 08:18:11 +0200
committermarha <marha@users.sourceforge.net>2012-09-20 08:18:11 +0200
commit06d4ea68085558b94d8e9c937091e7b7fcc5d95a (patch)
tree01ff2f6a8d6ae430a526282d98eede21c7cfffd0 /libxcb
parent52213f2cd11c6cc7210cea6896ed464fddfe3fec (diff)
downloadvcxsrv-06d4ea68085558b94d8e9c937091e7b7fcc5d95a.tar.gz
vcxsrv-06d4ea68085558b94d8e9c937091e7b7fcc5d95a.tar.bz2
vcxsrv-06d4ea68085558b94d8e9c937091e7b7fcc5d95a.zip
libxcb xserver pixman mesa git update 20 sep 2012
libxcb: 08cc068ead7b8e678cdb119b38ada5261d5cc3ea xserver: 70e5766874a919039678bb2ed75f2ccea0cb4345 pixman: 3124a51abb89475b8c5045bc96e04c5852694a16 mesa: bd8fb9e80562fbe0ff76cae50fc411635096f3a9
Diffstat (limited to 'libxcb')
-rw-r--r--libxcb/configure.ac7
-rw-r--r--libxcb/src/xcb_conn.c7
2 files changed, 13 insertions, 1 deletions
diff --git a/libxcb/configure.ac b/libxcb/configure.ac
index d6b953165..3f44b534d 100644
--- a/libxcb/configure.ac
+++ b/libxcb/configure.ac
@@ -117,6 +117,13 @@ dnl check for support for Solaris Trusted Extensions
AC_CHECK_HEADERS([tsol/label.h])
AC_CHECK_FUNCS([is_system_labeled])
+dnl check for IOV_MAX, and fall back to UIO_MAXIOV on BSDish systems
+AC_CHECK_DECL([IOV_MAX], [],
+ [AC_CHECK_DECL([UIO_MAXIOV], [AC_DEFINE([IOV_MAX], [UIO_MAXIOV])],
+ [AC_DEFINE([IOV_MAX], [16], [Define if not provided by <limits.h>])],
+ [[#include <sys/uio.h>]])],
+ [[#include <limits.h>]])
+
xcbincludedir='${includedir}/xcb'
AC_SUBST(xcbincludedir)
diff --git a/libxcb/src/xcb_conn.c b/libxcb/src/xcb_conn.c
index 7979491d3..e01d56682 100644
--- a/libxcb/src/xcb_conn.c
+++ b/libxcb/src/xcb_conn.c
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
+#include <limits.h>
#include "xcb.h"
#include "xcbint.h"
@@ -209,7 +210,11 @@ static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count)
i++;
}
#else
- n = writev(c->fd, *vector, *count);
+ n = *count;
+ if (n > IOV_MAX)
+ n = IOV_MAX;
+
+ n = writev(c->fd, *vector, n);
if(n < 0 && errno == EAGAIN)
return 1;
#endif /* _WIN32 */