summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-06-13 00:54:19 +0200
committerGravatar Nikias Bassen2019-06-13 00:54:19 +0200
commitca24570992df0bd5a0c6be26439acbb1e0523c5f (patch)
treeca7dce6d6625dd6de7711bea581b831221d4a603
parent2501f51e0fe2fad17ce4966542138d3f32dd533c (diff)
downloadlibusbmuxd-ca24570992df0bd5a0c6be26439acbb1e0523c5f.tar.gz
libusbmuxd-ca24570992df0bd5a0c6be26439acbb1e0523c5f.tar.bz2
socket: Return -ETIMEDOUT when select() in socket_read_fd() reached the timeout
-rw-r--r--common/socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/socket.c b/common/socket.c
index aa97848..0ee8105 100644
--- a/common/socket.c
+++ b/common/socket.c
@@ -412,6 +412,10 @@ int socket_check_fd(int fd, fd_mode fdm, unsigned int timeout)
strerror(errno));
return -1;
}
+ } else if (sret == 0) {
+ if (verbose >= 2)
+ fprintf(stderr, "%s: timeout\n", __func__);
+ return -ETIMEDOUT;
}
} while (eagain);