summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2012-03-08 00:50:13 -0800
committerJeremy Huddleston <jeremyhu@apple.com>2012-03-08 00:50:13 -0800
commit9061ee45b8dbe5431c23e3f628089d703ccad0b1 (patch)
tree7ee799caed15f343b588da2943560ee01a8eeb4c
parent7d235c62f0d5bd0df1236cc52141c10c5d272a18 (diff)
darwin: Use read(2) rather than recv(2)
2dcf8b025be88a25d4333abdc28d425b88238d96 was causing some regressions on darwin, so go back to using read(2) there until I have time to investigate further. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--src/xcb_in.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xcb_in.c b/src/xcb_in.c
index 969cfc0..fdcc813 100644
--- a/src/xcb_in.c
+++ b/src/xcb_in.c
@@ -269,7 +269,11 @@ static int read_block(const int fd, void *buf, const ssize_t len)
int done = 0;
while(done < len)
{
+#ifdef __APPLE__
+ int ret = read(fd, ((char *) buf) + done, len - done);
+#else
int ret = recv(fd, ((char *) buf) + done, len - done,MSG_WAITALL);
+#endif
if(ret > 0)
done += ret;
#ifndef _WIN32
@@ -661,7 +665,11 @@ void _xcb_in_replies_done(xcb_connection_t *c)
int _xcb_in_read(xcb_connection_t *c)
{
+#ifdef __APPLE__
+ int n = read(c->fd, c->in.queue + c->in.queue_len, sizeof(c->in.queue) - c->in.queue_len);
+#else
int n = recv(c->fd, c->in.queue + c->in.queue_len, sizeof(c->in.queue) - c->in.queue_len,MSG_WAITALL);
+#endif
if(n > 0)
c->in.queue_len += n;
while(read_packet(c))