gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. 88d41118235aba6f029d


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 88d41118235aba6f029da63201c62fedb833421a
Date: Fri, 15 Oct 2010 19:36:40 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  88d41118235aba6f029da63201c62fedb833421a (commit)
      from  1072f2a5e84feea7301bc072af8ad19a263e650e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=88d41118235aba6f029da63201c62fedb833421a


commit 88d41118235aba6f029da63201c62fedb833421a
Author: Sandro Santilli <address@hidden>
Date:   Fri Oct 15 21:36:26 2010 +0200

    Ask not to get sigpipe, hopefully in a standard way now

diff --git a/libbase/Socket.cpp b/libbase/Socket.cpp
index 7d1834e..70a6ce5 100644
--- a/libbase/Socket.cpp
+++ b/libbase/Socket.cpp
@@ -28,6 +28,7 @@ namespace {
 
 #include <cstring>
 #include <cerrno>
+#include <csignal>
 #include <boost/lexical_cast.hpp>
 
 #include "URL.h"
@@ -320,17 +321,17 @@ Socket::write(const void* src, std::streamsize num)
 
     const char* buf = static_cast<const char*>(src);
 
+    // For broken pipe we prefer being notified with
+    // a return of -1 from ::send.
+    sighandler_t oldSig = signal(SIGPIPE, SIG_IGN);
+
     while (toWrite > 0) {
-        // I'd like to get no SIGPIPE here, as we wouldn't
-        // know how to handle. Instead, for broken pipe I'd
-        // prefer being notified with a return of -1.
-        // Is that possible, in a standard way ?
-        // MSG_NOSIGNAL was reported as being non-standard flag..
         bytesSent = ::send(_socket, buf, toWrite, 0);
         if (bytesSent < 0) {
             const int err = errno;
             log_error("Socket send error %s", std::strerror(err));
             _error = true;
+            signal(SIGPIPE, oldSig);
             return 0;
         }
 
@@ -338,6 +339,7 @@ Socket::write(const void* src, std::streamsize num)
         toWrite -= bytesSent;
         buf += bytesSent;
     }
+    signal(SIGPIPE, oldSig);
     return num - toWrite;
 }
 

-----------------------------------------------------------------------

Summary of changes:
 libbase/Socket.cpp |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]