From 214553972d126784157d6f6c2c12ce420a4de6c6 Mon Sep 17 00:00:00 2001 From: Martin Hurton Date: Tue, 12 Aug 2014 10:51:27 +0200 Subject: [PATCH] Return -1 when failed to publish message --- src/xpub.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xpub.cpp b/src/xpub.cpp index e9979fd7..58f51297 100644 --- a/src/xpub.cpp +++ b/src/xpub.cpp @@ -131,8 +131,10 @@ int zmq::xpub_t::xsend (msg_t *msg_) subscriptions.match ((unsigned char*) msg_->data (), msg_->size (), mark_as_matching, this); - if (nodrop && !dist.check_hwm ()) - return EAGAIN; + if (nodrop && !dist.check_hwm ()) { + errno = EAGAIN; + return -1; + } // Send the message to all the pipes that were marked as matching // in the previous step.