mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Fix previous errno saving fix.
This commit is contained in:
committed by
Simon Kelley
parent
08619211f8
commit
71aaa5a791
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user