--- sa.c 2004/02/17 09:21:05 1.76
+++ sa.c 2004/03/26 16:05:59 1.77
@@ -939,7 +939,7 @@
if (sa->fdSocket == -1)
return SA_OK;
-#if defined(SO_RCVTIMEO) && defined(SO_SNDTIMEO)
+#if defined(SO_RCVTIMEO) && defined(USE_SO_RCVTIMEO) && defined(SO_SNDTIMEO) && defined(USE_SO_SNDTIMEO)
if (SA_TVISZERO(sa->tvTimeout[SA_TIMEOUT_READ])) {
if (setsockopt(sa->fdSocket, SOL_SOCKET, SO_RCVTIMEO,
(const void *)(&sa->tvTimeout[SA_TIMEOUT_READ]),
@@ -1737,13 +1737,13 @@
static int sa_read_raw(sa_t *sa, char *cpBuf, int nBufLen)
{
int rv;
-#if !(defined(SO_RCVTIMEO) && defined(SO_SNDTIMEO))
+#if !(defined(SO_RCVTIMEO) && defined(USE_SO_RCVTIMEO) && defined(SO_SNDTIMEO) && defined(USE_SO_SNDTIMEO))
fd_set fds;
#endif
/* if timeout is enabled, perform explicit/smart blocking instead
of implicitly/hard blocking in the read(2) system call */
-#if !(defined(SO_RCVTIMEO) && defined(SO_SNDTIMEO))
+#if !(defined(SO_RCVTIMEO) && defined(USE_SO_RCVTIMEO) && defined(SO_SNDTIMEO) && defined(USE_SO_SNDTIMEO))
if (!SA_TVISZERO(sa->tvTimeout[SA_TIMEOUT_READ])) {
FD_ZERO(&fds);
FD_SET(sa->fdSocket, &fds);
@@ -1763,7 +1763,7 @@
rv = (int)SA_SC_CALL_3(sa, read, sa->fdSocket, cpBuf, (size_t)nBufLen);
} while (rv == -1 && errno == EINTR);
-#if defined(SO_RCVTIMEO) && defined(SO_SNDTIMEO)
+#if defined(SO_RCVTIMEO) && defined(USE_SO_RCVTIMEO) && defined(SO_SNDTIMEO) && defined(USE_SO_SNDTIMEO)
if (rv == -1 && errno == EWOULDBLOCK)
errno = ETIMEDOUT;
#endif
@@ -1916,13 +1916,13 @@
static int sa_write_raw(sa_t *sa, const char *cpBuf, int nBufLen)
{
int rv;
-#if !(defined(SO_RCVTIMEO) && defined(SO_SNDTIMEO))
+#if !(defined(SO_RCVTIMEO) && defined(USE_SO_RCVTIMEO) && defined(SO_SNDTIMEO) && defined(USE_SO_SNDTIMEO))
fd_set fds;
#endif
/* if timeout is enabled, perform explicit/smart blocking instead
of implicitly/hard blocking in the write(2) system call */
-#if !(defined(SO_RCVTIMEO) && defined(SO_SNDTIMEO))
+#if !(defined(SO_RCVTIMEO) && defined(USE_SO_RCVTIMEO) && defined(SO_SNDTIMEO) && defined(USE_SO_SNDTIMEO))
if (!SA_TVISZERO(sa->tvTimeout[SA_TIMEOUT_WRITE])) {
FD_ZERO(&fds);
FD_SET(sa->fdSocket, &fds);
@@ -1942,7 +1942,7 @@
rv = (int)SA_SC_CALL_3(sa, write, sa->fdSocket, cpBuf, (size_t)nBufLen);
} while (rv == -1 && errno == EINTR);
-#if defined(SO_RCVTIMEO) && defined(SO_SNDTIMEO)
+#if defined(SO_RCVTIMEO) && defined(USE_SO_RCVTIMEO) && defined(SO_SNDTIMEO) && defined(USE_SO_SNDTIMEO)
if (rv == -1 && errno == EWOULDBLOCK)
errno = ETIMEDOUT;
#endif
|