Commit 71aaa5a7 authored by Matthias Andree's avatar Matthias Andree Committed by Simon Kelley

Fix previous errno saving fix.

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