Commit d262c52e authored by Rusty Russell's avatar Rusty Russell

net: use close_noerr.

Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 1fe2fa08
......@@ -231,7 +231,7 @@ static bool should_listen(const struct addrinfo *addrinfo)
static int make_listen_fd(const struct addrinfo *addrinfo)
{
int saved_errno, fd, on = 1;
int fd, on = 1;
fd = socket(addrinfo->ai_family, addrinfo->ai_socktype,
addrinfo->ai_protocol);
......@@ -247,9 +247,7 @@ static int make_listen_fd(const struct addrinfo *addrinfo)
return fd;
fail:
saved_errno = errno;
close(fd);
errno = saved_errno;
close_noerr(fd);
return -1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment