Fix previous errno saving fix.

This commit is contained in:
Matthias Andree
2013-12-03 11:20:45 +00:00
committed by Simon Kelley
parent 08619211f8
commit 71aaa5a791

View File

@@ -657,7 +657,7 @@ static int make_sock(union mysockaddr *addr, int type, int dienow)
if ((fd = socket(family, type, 0)) == -1)
{
int port;
int port, errsav;
char *s;
/* No error if the kernel just doesn't support this IP flavour */
@@ -667,17 +667,16 @@ static int make_sock(union mysockaddr *addr, int type, int dienow)
return -1;
err:
errsav = errno;
port = prettyprint_addr(addr, daemon->addrbuff);
if (!option_bool(OPT_NOWILD) && !option_bool(OPT_CLEVERBIND))
sprintf(daemon->addrbuff, "port %d", port);
s = _("failed to create listening socket for %s: %s");
if (fd != -1)
{
int errsav = errno;
close (fd);
errno = errsav;
}
close (fd);
errno = errsav;
if (dienow)
{