[zeromq-dev] zmq_msg_copy() of empty message returns EINVAL
Thomas Rodgers
rodgert at twrodgers.com
Wed Jul 2 21:25:29 CEST 2014
My bad, I was not calling zmq_msg_init() on the destination message first,
so the internal call to close() was returning EINVAL.
Nothing to see here, move along.
On Wed, Jul 2, 2014 at 1:50 PM, Pieter Hintjens <ph at imatix.com> wrote:
> There's no good reason for it. If you like, make a patch and get it to
> work as you'd expect.
>
> On Wed, Jul 2, 2014 at 8:22 PM, Thomas Rodgers <rodgert at twrodgers.com>
> wrote:
> > Just curious what the rationale for this is? The result of least
> > astonishment (to me anyway) would be a copy of an empty message.
> >
> > zmq_msg_t a;
> > zmq_msg_init(&a);
> >
> > ...
> >
> > zmq_msg_t b;
> > int rc = zmq_msg_copy(&b, &a);
> > assert(rc == 0); // fails, errno=EINVAL
> >
> >
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140702/a0e2bf66/attachment.htm>
More information about the zeromq-dev
mailing list