[zeromq-dev] [PATCH] Fix assertion in pgm_sender_t::plug() (LIBZMQ-303)

Martin Lucina martin at lucina.net
Sun Dec 25 03:04:53 CET 2011


Opening any PGM socket gives this assertion. The problem is in
pgm_sender_t::plug() which is incorrectly testing the return value from
session::write().

Signed-off-by: Martin Lucina <martin at lucina.net>
---
 src/pgm_sender.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/pgm_sender.cpp b/src/pgm_sender.cpp
index 759802f..1a1ae9a 100644
--- a/src/pgm_sender.cpp
+++ b/src/pgm_sender.cpp
@@ -98,8 +98,8 @@ void zmq::pgm_sender_t::plug (io_thread_t *io_thread_, session_base_t *session_)
     msg_t msg;
     msg.init_size (1);
     *(unsigned char*) msg.data () = 1;
-    bool ok = session_->write (&msg);
-    zmq_assert (ok);
+    int rc = session_->write (&msg);
+    errno_assert (rc == 0);
     session_->flush ();
 }
 
-- 
1.7.2.5




More information about the zeromq-dev mailing list