summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/idevicedebugserverproxy.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/tools/idevicedebugserverproxy.c b/tools/idevicedebugserverproxy.c
index 405a5a4..15e8deb 100644
--- a/tools/idevicedebugserverproxy.c
+++ b/tools/idevicedebugserverproxy.c
@@ -121,15 +121,8 @@ static void* connection_handler(void* data)
int dtimeout = 1;
while (!quit_flag) {
- fd_set read_fds = fds;
- struct timeval tv = { 0, 1000 };
- int ret_sel = select(client_fd+1, &read_fds, NULL, NULL, &tv);
- if (ret_sel < 0) {
- perror("select");
- break;
- }
- if (FD_ISSET(client_fd, &read_fds)) {
- ssize_t n = socket_receive(client_fd, buf, bufsize);
+ ssize_t n = socket_receive_timeout(client_fd, buf, bufsize, 0, 1);
+ if (n != -ETIMEDOUT) {
if (n < 0) {
fprintf(stderr, "Failed to read from client fd: %s\n", strerror(-n));
break;