[zeromq-dev] ZMQ vs SPI: FD shenanigans

Olaf Mandel o.mandel at menlosystems.com
Thu Jan 22 14:21:08 CET 2015


Hello,

Am 21.01.2015 22:31, schrieb KIU Shueng Chuan:
> Are you sure that the ioctl call failed? You are printing out errno without
> having checked the return code of the ioctl call.
-Snipp-

that actually was the problem!!! My own code had more debug checks to
verify that none of the previous calls failed. But that debug code never
checked the contents of errno before the end!

zmq_bind() may return successfully (zmq_bind() == 0), but it still
leaves errno non-equal to zero. And in my "real" program I didn't use
the return code of the ioctl call but the errno value.

Thank you for helping me find this!

Now the question: is it proper behaviour of zmq_bind() to change errno
to a non-success value and then return successfully? Or should ZMQ
everywhere that it works around "temporary" errors reset errno to zero
on success?

Best regards,
Olaf Mandel
-- 
Olaf Mandel
phone: +49-89-189166-250
fax:   +49-89-189166-111
Menlo Systems GmbH
Am Klopferspitz 19a, D-82152 Martinsried
Amtsgericht München HRB 138145
Geschäftsführung: Dr Michael Mei, Dr Ronald Holzwarth
USt-IdNr. DE217772017, St.-Nr. 14316170324

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150122/4e886d0b/attachment.sig>


More information about the zeromq-dev mailing list