diff options
author | marha <marha@users.sourceforge.net> | 2012-09-20 08:33:45 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-09-20 08:33:45 +0200 |
commit | 210f44f785e5b0da1bfe6ea68ad8f31c4ad2e282 (patch) | |
tree | 906904bdff9c33a3f9ded24ba8c89488469c5d94 /libxcb | |
parent | 821b51e814fe14d35f3807c525e4387022b9ed80 (diff) | |
parent | 06d4ea68085558b94d8e9c937091e7b7fcc5d95a (diff) | |
download | vcxsrv-210f44f785e5b0da1bfe6ea68ad8f31c4ad2e282.tar.gz vcxsrv-210f44f785e5b0da1bfe6ea68ad8f31c4ad2e282.tar.bz2 vcxsrv-210f44f785e5b0da1bfe6ea68ad8f31c4ad2e282.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
libxcb xserver pixman mesa git update 20 sep 2012
Conflicts:
libxcb/src/xcb_conn.c
Diffstat (limited to 'libxcb')
-rw-r--r-- | libxcb/configure.ac | 7 | ||||
-rw-r--r-- | libxcb/src/xcb_conn.c | 7 |
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 45ada1fb7..c14d40123 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" @@ -230,7 +231,11 @@ static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count) } #else assert(!c->out.queue_len); - 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 */ |