aboutsummaryrefslogtreecommitdiff
path: root/libxcb/src/xcb_util.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-13 16:54:57 +0100
committermarha <marha@users.sourceforge.net>2012-01-13 16:54:57 +0100
commit5cfbe97cd797d8f78ece208bb5114704b83d8aab (patch)
tree5c88c73ee39367742bb5547ef6fb5a3d25d656e0 /libxcb/src/xcb_util.c
parent39324211d7a79ef8115fd1e39771a2e400b31993 (diff)
downloadvcxsrv-5cfbe97cd797d8f78ece208bb5114704b83d8aab.tar.gz
vcxsrv-5cfbe97cd797d8f78ece208bb5114704b83d8aab.tar.bz2
vcxsrv-5cfbe97cd797d8f78ece208bb5114704b83d8aab.zip
libxtrans libXdmcp libxcb mesa xserver git update 13 jan 2012
Diffstat (limited to 'libxcb/src/xcb_util.c')
-rw-r--r--libxcb/src/xcb_util.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/libxcb/src/xcb_util.c b/libxcb/src/xcb_util.c
index fcb11f042..9329b81dd 100644
--- a/libxcb/src/xcb_util.c
+++ b/libxcb/src/xcb_util.c
@@ -34,11 +34,11 @@
#include <stddef.h>
#include <unistd.h>
#include <string.h>
-#include <arpa/inet.h>
#ifdef _WIN32
#include "xcb_windefs.h"
#else
+#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
@@ -424,13 +424,24 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname,
int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp);
if(!parsed) {
- c = (xcb_connection_t *) &error_connection;
+ c = _xcb_conn_ret_error(XCB_CONN_CLOSED_PARSE_ERR);
goto out;
- } else
+ } else {
+#ifdef _WIN32
+ WSADATA wsaData;
+ if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
+ c = (xcb_connection_t *) &error_connection;
+ goto out;
+ }
+#endif
fd = _xcb_open(host, protocol, display);
+ }
if(fd == -1) {
- c = (xcb_connection_t *) &error_connection;
+ c = _xcb_conn_ret_error(XCB_CONN_ERROR);
+#ifdef _WIN32
+ WSACleanup();
+#endif
goto out;
}