summaryrefslogtreecommitdiff
path: root/pjlib/src/pj/sock_bsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib/src/pj/sock_bsd.c')
-rw-r--r--pjlib/src/pj/sock_bsd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pjlib/src/pj/sock_bsd.c b/pjlib/src/pj/sock_bsd.c
index 9bd0356f..e3afcad5 100644
--- a/pjlib/src/pj/sock_bsd.c
+++ b/pjlib/src/pj/sock_bsd.c
@@ -654,6 +654,11 @@ PJ_DEF(pj_status_t) pj_sock_send(pj_sock_t sock,
PJ_CHECK_STACK();
PJ_ASSERT_RETURN(len, PJ_EINVAL);
+#ifdef MSG_NOSIGNAL
+ /* Suppress SIGPIPE. See https://trac.pjsip.org/repos/ticket/1538 */
+ flags |= MSG_NOSIGNAL;
+#endif
+
*len = send(sock, (const char*)buf, *len, flags);
if (*len < 0)