Commit 08a110ca authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '6ee1cb57'

* commit '6ee1cb57':
  libavformat: use MSG_NOSIGNAL when applicable
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 215db293 6ee1cb57
...@@ -111,6 +111,10 @@ struct sockaddr_storage { ...@@ -111,6 +111,10 @@ struct sockaddr_storage {
}; };
#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */ #endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0
#endif
#if !HAVE_STRUCT_ADDRINFO #if !HAVE_STRUCT_ADDRINFO
struct addrinfo { struct addrinfo {
int ai_flags; int ai_flags;
......
...@@ -143,7 +143,7 @@ static int ff_sctp_send(int s, const void *msg, size_t len, ...@@ -143,7 +143,7 @@ static int ff_sctp_send(int s, const void *msg, size_t len,
memcpy(CMSG_DATA(cmsg), sinfo, sizeof(struct sctp_sndrcvinfo)); memcpy(CMSG_DATA(cmsg), sinfo, sizeof(struct sctp_sndrcvinfo));
} }
return sendmsg(s, &outmsg, flags); return sendmsg(s, &outmsg, flags | MSG_NOSIGNAL);
} }
typedef struct SCTPContext { typedef struct SCTPContext {
...@@ -302,7 +302,7 @@ static int sctp_write(URLContext *h, const uint8_t *buf, int size) ...@@ -302,7 +302,7 @@ static int sctp_write(URLContext *h, const uint8_t *buf, int size)
} }
ret = ff_sctp_send(s->fd, buf + 2, size - 2, &info, MSG_EOR); ret = ff_sctp_send(s->fd, buf + 2, size - 2, &info, MSG_EOR);
} else } else
ret = send(s->fd, buf, size, 0); ret = send(s->fd, buf, size, MSG_NOSIGNAL);
return ret < 0 ? ff_neterrno() : ret; return ret < 0 ? ff_neterrno() : ret;
} }
......
...@@ -186,7 +186,7 @@ static int tcp_write(URLContext *h, const uint8_t *buf, int size) ...@@ -186,7 +186,7 @@ static int tcp_write(URLContext *h, const uint8_t *buf, int size)
if (ret) if (ret)
return ret; return ret;
} }
ret = send(s->fd, buf, size, 0); ret = send(s->fd, buf, size, MSG_NOSIGNAL);
return ret < 0 ? ff_neterrno() : ret; return ret < 0 ? ff_neterrno() : ret;
} }
......
...@@ -123,7 +123,7 @@ static int unix_write(URLContext *h, const uint8_t *buf, int size) ...@@ -123,7 +123,7 @@ static int unix_write(URLContext *h, const uint8_t *buf, int size)
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
ret = send(s->fd, buf, size, 0); ret = send(s->fd, buf, size, MSG_NOSIGNAL);
return ret < 0 ? ff_neterrno() : ret; return ret < 0 ? ff_neterrno() : ret;
} }
......
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