From 6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f Mon Sep 17 00:00:00 2001 From: Rémi Denis-Courmont Date: Wed, 20 Aug 2014 23:06:07 +0300 Subject: libavformat: use MSG_NOSIGNAL when applicable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the remote end of a connection oriented socket hangs up, generating an EPIPE error is preferable over an unhandled SIGPIPE signal. Signed-off-by: Martin Storsjö --- libavformat/sctp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavformat/sctp.c') diff --git a/libavformat/sctp.c b/libavformat/sctp.c index 66b31ccec6..84a4ac1938 100644 --- a/libavformat/sctp.c +++ b/libavformat/sctp.c @@ -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)); } - return sendmsg(s, &outmsg, flags); + return sendmsg(s, &outmsg, flags | MSG_NOSIGNAL); } typedef struct SCTPContext { @@ -300,7 +300,7 @@ static int sctp_write(URLContext *h, const uint8_t *buf, int size) abort(); ret = ff_sctp_send(s->fd, buf + 2, size - 2, &info, MSG_EOR); } else - ret = send(s->fd, buf, size, 0); + ret = send(s->fd, buf, size, MSG_NOSIGNAL); return ret < 0 ? ff_neterrno() : ret; } -- cgit v1.2.3