maxfd = dsi->socket + 1;
while (1) {
+ if (dsi->socket == -1)
+ /* eg dsi_disconnect() might have disconnected us */
+ return -1;
FD_ZERO(&readfds);
FD_ZERO(&writefds);
goto exit;
}
if (errno == EAGAIN || errno == EWOULDBLOCK) {
-#ifdef SOLARIS
+#if defined(SOLARIS) || defined(FREEBSD)
if (pos > offset) {
/* we actually have sent sth., adjust counters and keep trying */
len = pos - offset;