From ca24570992df0bd5a0c6be26439acbb1e0523c5f Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 13 Jun 2019 00:54:19 +0200 Subject: socket: Return -ETIMEDOUT when select() in socket_read_fd() reached the timeout --- common/socket.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- cgit v1.1-32-gdbae