vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Tue May 19 
23:28:54 2015 +0300| [5287f8e10cd8542a672785d49b315c3eefcd2981] | committer: 
Rémi Denis-Courmont

network: use send(MSG_NOSIGNAL) in net_Write()

This ensures that SIGPIPE is not emitted if the connection is closed by
the other end. Using send() is fine given that all net_Write(),
net_vaPrintf() and net_Printf() call sites use (only) sockets.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5287f8e10cd8542a672785d49b315c3eefcd2981
---

 src/network/io.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/network/io.c b/src/network/io.c
index 586765d..48a03a3 100644
--- a/src/network/io.c
+++ b/src/network/io.c
@@ -354,7 +354,7 @@ error:
 
 #undef net_Write
 /**
- * Writes data to a file descriptor.
+ * Writes data to a socket.
  * This blocks until all data is written or an error occurs.
  *
  * This function is a cancellation point.
@@ -407,11 +407,7 @@ ssize_t net_Write( vlc_object_t *p_this, int fd,
             }
         }
 
-#ifdef _WIN32
-        ssize_t val = send (fd, p_data, i_data, 0);
-#else
-        ssize_t val = write (fd, p_data, i_data);
-#endif
+        ssize_t val = send (fd, p_data, i_data, MSG_NOSIGNAL);
         if (val == -1)
         {
             if (errno == EINTR)

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to