]> sjero.net Git - wget/blobdiff - src/connect.c
[svn] Expect existence of C89 functions, as well as of select and gettimeofday.
[wget] / src / connect.c
index 16b6de6c3412c0ea8abbd7e6b145d35e3174cfef..0b58ffadae37e5456be93ea4e336cf8b8ad7ecfc 100644 (file)
@@ -31,7 +31,6 @@ so, delete this exception statement from your version.  */
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/types.h>
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
@@ -47,11 +46,7 @@ so, delete this exception statement from your version.  */
 #endif /* not WINDOWS */
 
 #include <errno.h>
-#ifdef HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif /* HAVE_STRING_H */
+#include <string.h>
 #ifdef HAVE_SYS_SELECT_H
 # include <sys/select.h>
 #endif /* HAVE_SYS_SELECT_H */
@@ -62,10 +57,6 @@ so, delete this exception statement from your version.  */
 #include "connect.h"
 #include "hash.h"
 
-#ifndef errno
-extern int errno;
-#endif
-
 /* Define sockaddr_storage where unavailable (presumably on IPv4-only
    hosts).  */
 
@@ -620,7 +611,6 @@ retryable_socket_connect_error (int err)
 int
 select_fd (int fd, double maxtime, int wait_for)
 {
-#ifdef HAVE_SELECT
   fd_set fdset;
   fd_set *rd = NULL, *wr = NULL;
   struct timeval tmout;
@@ -641,23 +631,11 @@ select_fd (int fd, double maxtime, int wait_for)
   while (result < 0 && errno == EINTR);
 
   return result;
-
-#else  /* not HAVE_SELECT */
-
-  /* If select() unavailable, just return 1.  In most usages in Wget,
-     this is the appropriate response -- "if we can't poll, go ahead
-     with the blocking operation".  If a specific part of code needs
-     different behavior, it can use #ifdef HAVE_SELECT to test whether
-     polling really occurs.  */
-  return 1;
-
-#endif /* not HAVE_SELECT */
 }
 
 int
 test_socket_open (int sock)
 {
-#ifdef HAVE_SELECT
   fd_set check_set;
   struct timeval to;
 
@@ -679,10 +657,6 @@ test_socket_open (int sock)
     }
   else
     return 0;
-#else
-  /* Without select, it's hard to know for sure. */
-  return 1;
-#endif
 }
 \f
 /* Basic socket operations, mostly EINTR wrappers.  */