net_Close (fd);
#if !defined(WIN32) && !defined(UNDER_CE)
fd = rootwrap_bind (ptr->ai_family, socktype,
- protocol ?: ptr->ai_protocol, ptr->ai_addr,
- ptr->ai_addrlen);
+ protocol ? protocol : ptr->ai_protocol,
+ ptr->ai_addr, ptr->ai_addrlen);
if (fd != -1)
{
msg_Dbg (p_this, "got socket %d from rootwrap", fd);
/*****************************************************************************
* __net_Read:
*****************************************************************************
- * Reads from a network socket.
+ * Reads from a network socket. Cancellation point.
* If waitall is true, then we repeat until we have read the right amount of
* data; in that case, a short count means EOF has been reached or the VLC
* object has been signaled.
ssize_t n;
if (vs != NULL)
{
+ int canc = vlc_savecancel ();
n = vs->pf_recv (vs->p_sys, p_buf, i_buflen);
+ vlc_restorecancel (canc);
}
else
{
switch (errno)
{
case EAGAIN: /* spurious wakeup or no TLS data */
+#if (EAGAIN != EWOULDBLOCK)
+ case EWOULDBLOCK:
+#endif
case EINTR: /* asynchronous signal */
continue;
}
return i_ret;
}
-
-#ifdef WIN32
- /* vlc_sendmsg, vlc_recvmsg Defined in winsock.c */
-#else /* !WIN32 */
-ssize_t vlc_sendmsg (int s, struct msghdr *hdr, int flags)
-{
- return sendmsg (s, hdr, flags);
-}
-
-ssize_t vlc_recvmsg (int s, struct msghdr *hdr, int flags)
-{
- return recvmsg (s, hdr, flags);
-}
-#endif /* WIN32 */
-