aboutsummaryrefslogtreecommitdiffstats
path: root/android/sync-utils.c
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2011-02-07 14:14:14 -0800
committerVladimir Chtchetkine <vchtchetkine@google.com>2011-02-07 14:49:09 -0800
commit17ecca637df2f573edc3ecb8246c0e38a5b32465 (patch)
treebc05a46566ad888b4659b048851b1e32a9fb5b92 /android/sync-utils.c
parent9af6946145bea73b16f1a128838048b917474f27 (diff)
downloadexternal_qemu-17ecca637df2f573edc3ecb8246c0e38a5b32465.zip
external_qemu-17ecca637df2f573edc3ecb8246c0e38a5b32465.tar.gz
external_qemu-17ecca637df2f573edc3ecb8246c0e38a5b32465.tar.bz2
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
Diffstat (limited to 'android/sync-utils.c')
-rw-r--r--android/sync-utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/android/sync-utils.c b/android/sync-utils.c
index 6d3cea6..617ba8b 100644
--- a/android/sync-utils.c
+++ b/android/sync-utils.c
@@ -74,6 +74,7 @@ syncsocket_connect(int fd, SockAddress* sockaddr, int timeout)
connect_status = iolooper_wait(looper, timeout);
if (connect_status > 0) {
iolooper_del_write(looper, fd);
+ break;
} else {
iolooper_free(looper);
return NULL;
@@ -184,7 +185,7 @@ syncsocket_read_absolute(SyncSocket* ssocket,
return -1;
}
do {
- ret = read(ssocket->fd, buf, size);
+ ret = socket_recv(ssocket->fd, buf, size);
} while( ret < 0 && errno == EINTR);
} else if (ret == 0) {
// Timed out
@@ -229,7 +230,7 @@ syncsocket_write_absolute(SyncSocket* ssocket,
}
do {
- ret = write(ssocket->fd, (const char*)buf + written, size - written);
+ ret = socket_send(ssocket->fd, (const char*)buf + written, size - written);
} while( ret < 0 && errno == EINTR);
if (ret > 0) {