From 17ecca637df2f573edc3ecb8246c0e38a5b32465 Mon Sep 17 00:00:00 2001 From: Vladimir Chtchetkine Date: Mon, 7 Feb 2011 14:14:14 -0800 Subject: Fix emulator core and UI on Windows There are two parts in this CL: 1. Fixing the Windows build (missing set_fd_handler) 2. Replacing read/write with socket_recv/socket_send. Change-Id: I5fa599774260257d481b738a892e1124135fc319 --- android/protocol/fb-updates-impl.c | 4 ++-- android/protocol/ui-commands-impl.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'android/protocol') diff --git a/android/protocol/fb-updates-impl.c b/android/protocol/fb-updates-impl.c index fa4b304..dde79c1 100644 --- a/android/protocol/fb-updates-impl.c +++ b/android/protocol/fb-updates-impl.c @@ -113,8 +113,8 @@ _fbUpdatesImpl_io_callback(void* opaque, int fd, unsigned events) // Read updates while they are immediately available. for (;;) { // Read next chunk of data. - ret = read(fbi->sock, fbi->reader_buffer + fbi->reader_offset, - fbi->reader_bytes - fbi->reader_offset); + ret = socket_recv(fbi->sock, fbi->reader_buffer + fbi->reader_offset, + fbi->reader_bytes - fbi->reader_offset); if (ret == 0) { /* disconnection ! */ fbUpdatesImpl_destroy(); diff --git a/android/protocol/ui-commands-impl.c b/android/protocol/ui-commands-impl.c index e933d57..2ceeca1 100644 --- a/android/protocol/ui-commands-impl.c +++ b/android/protocol/ui-commands-impl.c @@ -124,8 +124,9 @@ _uiCmdImpl_io_callback(void* opaque, int fd, unsigned events) // Read requests while they are immediately available. for (;;) { // Read next chunk of data. - status = read(uicmd->sock, uicmd->reader_buffer + uicmd->reader_offset, - uicmd->reader_bytes - uicmd->reader_offset); + status = socket_recv(uicmd->sock, + uicmd->reader_buffer + uicmd->reader_offset, + uicmd->reader_bytes - uicmd->reader_offset); if (status == 0) { /* Disconnection, meaning that the core process got terminated. */ fprintf(stderr, "core-ui-control service got disconnected\n"); -- cgit v1.1