summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-25 13:26:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-25 13:27:21 +0200
commit08a110ca871e82630d5f6f834922014cd375f524 (patch)
tree6c9569ebd49b54dd5290cb6de8d1b96fb8e7be63
parent215db2935b06c0e936dadce012a31de7da25ba97 (diff)
parent6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f (diff)
Merge commit '6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f'
* commit '6ee1cb5740e7490151db7dcec7e20ceaf8a2fe1f': libavformat: use MSG_NOSIGNAL when applicable Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/network.h4
-rw-r--r--libavformat/sctp.c4
-rw-r--r--libavformat/tcp.c2
-rw-r--r--libavformat/unix.c2
4 files changed, 8 insertions, 4 deletions
diff --git a/libavformat/network.h b/libavformat/network.h
index 5ca906491a..d89a62daa3 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -111,6 +111,10 @@ struct sockaddr_storage {
};
#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
+#ifndef MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0
+#endif
+
#if !HAVE_STRUCT_ADDRINFO
struct addrinfo {
int ai_flags;
diff --git a/libavformat/sctp.c b/libavformat/sctp.c
index a4406d1e40..35b9ad15ab 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 {
@@ -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);
} else
- ret = send(s->fd, buf, size, 0);
+ ret = send(s->fd, buf, size, MSG_NOSIGNAL);
return ret < 0 ? ff_neterrno() : ret;
}
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index e457fba94f..3c3f4f53ab 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -186,7 +186,7 @@ static int tcp_write(URLContext *h, const uint8_t *buf, int size)
if (ret)
return ret;
}
- ret = send(s->fd, buf, size, 0);
+ ret = send(s->fd, buf, size, MSG_NOSIGNAL);
return ret < 0 ? ff_neterrno() : ret;
}
diff --git a/libavformat/unix.c b/libavformat/unix.c
index 0e61318fbd..397706528a 100644
--- a/libavformat/unix.c
+++ b/libavformat/unix.c
@@ -123,7 +123,7 @@ static int unix_write(URLContext *h, const uint8_t *buf, int size)
if (ret < 0)
return ret;
}
- ret = send(s->fd, buf, size, 0);
+ ret = send(s->fd, buf, size, MSG_NOSIGNAL);
return ret < 0 ? ff_neterrno() : ret;
}