summaryrefslogtreecommitdiff
path: root/src/libs6dns/s6dns_engine.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-08-22 10:34:13 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-08-22 10:34:13 +0000
commit285054f4308819e7fcc1e69d2815efadabefca6a (patch)
tree0e9901b437bfe2e6431d89b03bd8f9ac7db30bd9 /src/libs6dns/s6dns_engine.c
parent5fd6a10bf8e59200da268901d0ba880485aa054f (diff)
downloads6-dns-285054f4308819e7fcc1e69d2815efadabefca6a.tar.xz
Don't save errno around fd_close ; prepare for 2.2.0.1
Diffstat (limited to 'src/libs6dns/s6dns_engine.c')
-rw-r--r--src/libs6dns/s6dns_engine.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/libs6dns/s6dns_engine.c b/src/libs6dns/s6dns_engine.c
index 06cb218..26cb5f3 100644
--- a/src/libs6dns/s6dns_engine.c
+++ b/src/libs6dns/s6dns_engine.c
@@ -104,17 +104,13 @@ static int thisudp (s6dns_engine_t *dt, tain_t const *stamp)
if (dt->fd < 0) return -1 ;
if (!randombind(dt->fd, s6dns_ip46list_is6(&dt->servers, dt->curserver)))
{
- int e = errno ;
fd_close(dt->fd) ; dt->fd = -1 ;
- errno = e ;
return -1 ;
}
if ((socketconnect46(dt->fd, s6dns_ip46list_ip(&dt->servers, dt->curserver), 53, s6dns_ip46list_is6(&dt->servers, dt->curserver)) < 0)
&& (errno != EINPROGRESS))
{
- int e = errno ;
fd_close(dt->fd) ; dt->fd = -1 ;
- errno = e ;
return 0 ;
}
tain_add(&dt->localdeadline, stamp, &tain_infinite_relative) ;
@@ -135,17 +131,13 @@ static int thistcp (s6dns_engine_t *dt, tain_t const *stamp)
if (dt->fd < 0) return -1 ;
if (!randombind(dt->fd, s6dns_ip46list_is6(&dt->servers, dt->curserver)))
{
- int e = errno ;
fd_close(dt->fd) ; dt->fd = -1 ;
- errno = e ;
return -1 ;
}
if ((socketconnect46(dt->fd, s6dns_ip46list_ip(&dt->servers, dt->curserver), 53, s6dns_ip46list_is6(&dt->servers, dt->curserver)) < 0)
&& (errno != EINPROGRESS))
{
- int e = errno ;
fd_close(dt->fd) ; dt->fd = -1 ;
- errno = e ;
return 0 ;
}
tain_addsec(&dt->localdeadline, stamp, 10) ;
@@ -255,9 +247,7 @@ static int s6dns_engine_read_udp (s6dns_engine_t *dt, tain_t const *stamp)
}
if (!stralloc_copyb(&dt->sa, buf, r))
{
- int e = errno ;
fd_close(dt->fd) ; dt->fd = -1 ;
- errno = e ;
return 0 ;
}
dt->querylen = 0 ;
@@ -314,9 +304,7 @@ void s6dns_engine_recycle (s6dns_engine_t *dt)
memset(&dt->servers, 0, sizeof(s6dns_ip46list_t)) ;
if (dt->fd >= 0)
{
- int e = errno ;
fd_close(dt->fd) ; dt->fd = -1 ;
- errno = e ;
}
dt->status = ECONNABORTED ;
dt->flagstrict = dt->flagtcp = dt->flagconnecting = dt->flagreading = dt->flagwriting = 0 ;