Commit 2f53298d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Even more strange error returns on Solaris

parent 8436484e
......@@ -56,16 +56,24 @@ int SUB_run(struct vsb *sb, sub_func_f *func, void *priv, const char *name,
#define VTCP_ADDRBUFSIZE 64
#define VTCP_PORTBUFSIZE 16
static inline int
VTCP_Check(int a)
{
if (a == 0)
return (1);
if (errno == ECONNRESET || errno == ENOTCONN)
return (1);
#if (defined (__SVR4) && defined (__sun)) || defined (__NetBSD__)
/*
* Solaris returns EINVAL if the other end unexepectedly reset the
* connection. This is a bug in Solaris and documented behaviour on NetBSD.
*/
#define VTCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN \
|| errno == EINVAL)
#else
#define VTCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN)
/*
* Solaris returns EINVAL if the other end unexepectedly reset the
* connection.
* This is a bug in Solaris and documented behaviour on NetBSD.
*/
if (errno == EINVAL || errno == ETIMEDOUT)
return (1);
#endif
return (0);
}
#define VTCP_Assert(a) assert(VTCP_Check(a))
......
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