]> sjero.net Git - wget/blobdiff - src/wget.h
[svn] Correctly check for unsupported socket families.
[wget] / src / wget.h
index 6cdfbeb0125f0dd79d468f70454c99df789c6d9a..edc159900a63fd04dabfa07d3acc087acc2fe549 100644 (file)
@@ -223,15 +223,15 @@ typedef enum
   SSLERRCERTFILE,SSLERRCERTKEY,SSLERRCTXCREATE
 } uerr_t;
 
-/* In case old systems don't have EAFNOSUPPORT, which we use below. */
-#ifndef EAFNOSUPPORT
-# define EAFNOSUPPORT EINVAL
-#endif
-
-#define CONNECT_ERROR(err) ((   (err) == EAFNOSUPPORT          \
-                            || (err) == EINVAL                 \
-                            || ((err) == ECONNREFUSED          \
-                                && !opt.retry_connrefused))    \
+/* Whether the connection was unsuccessful or impossible.  If the
+   connection is considered impossible (e.g. for unsupported socket
+   family errors), there is no sense in retrying.  "Connection
+   refused" is normally not retried, except when opt.retry_connrefused
+   is specified.  */
+
+#define CONNECT_ERROR(err) ((unsupported_socket_family_error (err)     \
+                            || ((err) == ECONNREFUSED                  \
+                                && !opt.retry_connrefused))            \
                            ? CONIMPOSSIBLE : CONERROR)
 
 #endif /* WGET_H */