if (poll (ufd, sizeof (ufd) / sizeof (ufd[0]), -1) < 0)
{
- if (errno =! EINTR)
+ if (errno != EINTR)
goto error;
continue;
}
{
if (ufd[1].revents)
{
+ assert (p_this->b_die);
msg_Dbg (p_this, "socket %d polling interrupted", fd);
#if defined(WIN32) || defined(UNDER_CE)
WSASetLastError (WSAEINTR);
if (errno != EINTR)
{
msg_Err (p_this, "Write error: %m");
- goto out;
+ goto error;
}
continue;
}
if (ufd[1].revents)
break;
}
+ else
+ {
+ if (ufd[1].revents)
+ {
+ assert (p_this->b_die);
+ errno = EINTR;
+ goto error;
+ }
+ }
if (p_vs != NULL)
val = p_vs->pf_send (p_vs->p_sys, p_data, i_data);
i_total += val;
}
-out:
if ((i_total > 0) || (i_data == 0))
return i_total;
+error:
return -1;
}