Commit 601d7d3f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Work around a Solaris bug.

Submitted by:	Nils Goroll
parent 2cd4ec22
......@@ -267,7 +267,13 @@ VTCP_set_read_timeout(int s, double seconds)
timeout.tv_sec = (int)floor(seconds);
timeout.tv_usec = (int)(1e6 * (seconds - timeout.tv_sec));
#ifdef SO_RCVTIMEO_WORKS
AZ(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout));
/*
* Solaris bug (present at least in snv_151 and older): If this fails
* with EINVAL, the socket is half-closed (SS_CANTSENDMORE) and the
* timeout does not get set. Needs to be fixed in Solaris, there is
* nothing we can do about this.
*/
VTCP_Assert(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof timeout));
#else
(void)s;
#endif
......
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