respondd: recv error handler now gets the right errno

This commit is contained in:
lemoer 2016-12-01 01:18:26 +01:00
parent 108f0846d6
commit b67c212eab
1 changed files with 3 additions and 0 deletions

View File

@ -460,6 +460,7 @@ static void accept_request(struct request_schedule *schedule, int sock,
struct in6_addr destaddr = {};
struct cmsghdr *cmsg;
unsigned int ifindex;
error_t recv_errno;
int64_t timeout = schedule_idle_time(schedule);
if (timeout < 0)
@ -488,9 +489,11 @@ static void accept_request(struct request_schedule *schedule, int sock,
};
input_bytes = recvmsg(sock, &mh, 0);
recv_errno = errno;
update_time();
// Timeout
errno = recv_errno;
if (input_bytes < 0 && (errno == EAGAIN || errno == EWOULDBLOCK))
return;