From 6d93a95e37c0e544abb13abd7860b3ef3d971317 Mon Sep 17 00:00:00 2001
From: hniksic <devnull@localhost>
Date: Mon, 3 Dec 2001 09:22:06 -0800
Subject: [PATCH] [svn] Declare h_errno in host.c, but not elsewhere.

---
 src/ChangeLog   | 11 +++++++++++
 src/ftp-basic.c |  2 +-
 src/ftp.c       | 17 -----------------
 src/host.c      |  6 ++++++
 src/http.c      | 11 -----------
 5 files changed, 18 insertions(+), 29 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 08d3733e..3f6c3bee 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
+2001-12-03  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+	* ftp-basic.c (ftp_port): Don't return HOSTERR if we fail getting
+	the socket data.
+
+	* ftp.c: Ditto.
+
+	* http.c: No need to declare h_errno.
+
+	* host.c: Declare h_errno.
+
 2001-12-02  Hrvoje Niksic  <hniksic@arsdigita.com>
 
 	* utils.c (file_merge): If BASE doesn't contain a slash, just
diff --git a/src/ftp-basic.c b/src/ftp-basic.c
index bd8c25bf..096010c3 100644
--- a/src/ftp-basic.c
+++ b/src/ftp-basic.c
@@ -255,7 +255,7 @@ ftp_port (struct rbuf *rbuf)
     return err;
   /* Get the address of this side of the connection.  */
   if (!(in_addr = conaddr (RBUF_FD (rbuf))))
-    return HOSTERR;
+    return BINDERR;
   /* Construct the argument of PORT (of the form a,b,c,d,e,f).  */
   bytes = (char *)alloca (6 * 4 + 1);
   sprintf (bytes, "%d,%d,%d,%d,%d,%d", in_addr[0], in_addr[1],
diff --git a/src/ftp.c b/src/ftp.c
index 00b0b638..1b78fd33 100644
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -33,9 +33,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/types.h>
 #include <assert.h>
 #include <errno.h>
-#ifndef WINDOWS
-# include <netdb.h>		/* for h_errno */
-#endif
 
 #include "wget.h"
 #include "utils.h"
@@ -51,11 +48,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #ifndef errno
 extern int errno;
 #endif
-#ifndef h_errno
-# ifndef __CYGWIN__
-extern int h_errno;
-# endif
-#endif
 
 /* File where the "ls -al" listing will be saved.  */
 #define LIST_FILENAME ".listing"
@@ -601,15 +593,6 @@ Error in server response, closing control connection.\n"));
 	      closeport (dtsock);
 	      return err;
 	      break;
-	    case HOSTERR:
-	      logputs (LOG_VERBOSE, "\n");
-	      logprintf (LOG_NOTQUIET, "%s: %s\n", u->host,
-			 herrmsg (h_errno));
-	      CLOSE (csock);
-	      closeport (dtsock);
-	      rbuf_uninitialize (&con->rbuf);
-	      return HOSTERR;
-	      break;
 	    case FTPPORTERR:
 	      logputs (LOG_VERBOSE, "\n");
 	      logputs (LOG_NOTQUIET, _("Invalid PORT.\n"));
diff --git a/src/host.c b/src/host.c
index 77984722..a769fd97 100644
--- a/src/host.c
+++ b/src/host.c
@@ -59,6 +59,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 extern int errno;
 #endif
 
+#ifndef h_errno
+# ifndef __CYGWIN__
+extern int h_errno;
+# endif
+#endif
+
 #define IP4_ADDRESS_LENGTH 4
 
 /* Mapping between known hosts and to lists of their addresses. */
diff --git a/src/http.c b/src/http.c
index 261b51e4..16f5dc2d 100644
--- a/src/http.c
+++ b/src/http.c
@@ -44,12 +44,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 # endif
 #endif
 
-#ifdef WINDOWS
-# include <winsock.h>
-#else
-# include <netdb.h>		/* for h_errno */
-#endif
-
 #include "wget.h"
 #include "utils.h"
 #include "url.h"
@@ -73,11 +67,6 @@ extern char *version_string;
 #ifndef errno
 extern int errno;
 #endif
-#ifndef h_errno
-# ifndef __CYGWIN__
-extern int h_errno;
-# endif
-#endif
 
 static int cookies_loaded_p;