From 99521cab7749c7009c9bb269cf94b7707cfbde48 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 2 Aug 2018 22:38:22 +0900 Subject: [PATCH] resolve: fix error handling of dns_stream_read() --- src/resolve/resolved-dns-stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resolve/resolved-dns-stream.c b/src/resolve/resolved-dns-stream.c index 8c6f217..c3ffc75 100644 --- a/src/resolve/resolved-dns-stream.c +++ b/src/resolve/resolved-dns-stream.c @@ -391,8 +391,8 @@ static int on_stream_io(sd_event_source *es, int fd, uint32_t revents, void *use (uint8_t*) DNS_PACKET_DATA(s->read_packet) + s->n_read - sizeof(s->read_size), sizeof(s->read_size) + be16toh(s->read_size) - s->n_read); if (ss < 0) { - if (!IN_SET(errno, EINTR, EAGAIN)) - return dns_stream_complete(s, errno); + if (!IN_SET(-ss, EINTR, EAGAIN)) + return dns_stream_complete(s, -ss); } else if (ss == 0) return dns_stream_complete(s, ECONNRESET); else -- 2.7.4