[master] 3b48594 Fix TCP_Check for NetBSD/EINVAL

Tollef Fog Heen tfheen at varnish-cache.org
Fri Apr 15 08:25:35 CEST 2011


commit 3b4859455803b606107c07b25b784372d5665a1f
Author: Daniel Bilik <daniel.bilik at neosystem.cz>
Date:   Fri Apr 15 08:24:05 2011 +0200

    Fix TCP_Check for NetBSD/EINVAL
    
    NetBSD returns EINVAL when the other end unexpectedly shuts down the
    connection, the same as Solaris, but on NetBSD it is documented.

diff --git a/include/libvarnish.h b/include/libvarnish.h
index f89a763..fb028d7 100644
--- a/include/libvarnish.h
+++ b/include/libvarnish.h
@@ -56,10 +56,10 @@ int SUB_run(struct vsb *sb, sub_func_f *func, void *priv, const char *name,
 #define TCP_ADDRBUFSIZE		64
 #define TCP_PORTBUFSIZE		16
 
-#if defined (__SVR4) && defined (__sun)
+#if (defined (__SVR4) && defined (__sun)) || defined (__NetBSD__)
 /*
  * Solaris returns EINVAL if the other end unexepectedly reset the
- * connection.  This is a bug in Solaris.
+ * connection.  This is a bug in Solaris and documented behaviour on NetBSD.
  */
 #define TCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN \
     || errno == EINVAL)



More information about the varnish-commit mailing list