summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Nisarg Jhaveri2021-02-17 17:31:54 +0530
committerGravatar Nisarg Jhaveri2021-02-17 17:31:54 +0530
commit4837527745d98b9314eec1a250e2e13ce1ec3031 (patch)
tree0f2749367cde6b98e370bbd5231578f199c81002 /tools
parent5ef9f5968012906b329c3de5fd5a5f9c5345dfa8 (diff)
downloadlibimobiledevice-4837527745d98b9314eec1a250e2e13ce1ec3031.tar.gz
libimobiledevice-4837527745d98b9314eec1a250e2e13ce1ec3031.tar.bz2
Remove redundent `select` call from idevicedebugserverproxy.c
- Turns out `socket_receive` anyway internally calls `select` again. Use `socket_receive_timeout` instead. - Remove logging for timeout in socket.c as well, it is not really an error condition
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;