Commit 31636e68 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Even more strange error returns on Solaris

parent bebf42d6
...@@ -33,16 +33,24 @@ ...@@ -33,16 +33,24 @@
#define VTCP_ADDRBUFSIZE 64 #define VTCP_ADDRBUFSIZE 64
#define VTCP_PORTBUFSIZE 16 #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__) #if (defined (__SVR4) && defined (__sun)) || defined (__NetBSD__)
/* /*
* Solaris returns EINVAL if the other end unexepectedly reset the * Solaris returns EINVAL if the other end unexepectedly reset the
* connection. This is a bug in Solaris and documented behaviour on NetBSD. * connection.
*/ * This is a bug in Solaris and documented behaviour on NetBSD.
#define VTCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN \ */
|| errno == EINVAL) if (errno == EINVAL || errno == ETIMEDOUT)
#else return (1);
#define VTCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN)
#endif #endif
return (0);
}
#define VTCP_Assert(a) assert(VTCP_Check(a)) #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