From: simon Date: Thu, 24 Sep 2009 10:05:09 +0000 (+0000) Subject: Greg Hewgill informs me that the problem another user had reported X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/agedu/commitdiff_plain/9827dd71b88e2c1080f1f31a40802cd44c98bf16 Greg Hewgill informs me that the problem another user had reported with unexpected EADDRNOTAVAIL on MacOS can be worked around by zeroing out the entire sockaddr_in structure before starting to put things in it. git-svn-id: svn://svn.tartarus.org/sgt/agedu@8660 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/httpd.c b/httpd.c index 62c1ceb..e5ee270 100644 --- a/httpd.c +++ b/httpd.c @@ -430,6 +430,7 @@ void run_httpd(const void *t, int authmask, const struct httpd_config *dcfg, fprintf(stderr, "socket(PF_INET): %s\n", strerror(errno)); exit(1); } + memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; if (!dcfg->address) { #ifdef RANDOM_LOCALHOST