mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-20 02:38:32 +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)
|
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)
|
|||||||
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)
|
||||||
{
|
close (fd);
|
||||||
int errsav = errno;
|
|
||||||
close (fd);
|
errno = errsav;
|
||||||
errno = errsav;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dienow)
|
if (dienow)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user