Commit 3b485945 authored by Daniel Bilik's avatar Daniel Bilik Committed by Tollef Fog Heen

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.
parent aa103397
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment