mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-14 09:47:56 +08:00
zmq_msg_init_data returns ERRNO instead aborting
Signed-off-by: Paul Colomiets <pc@gafol.net>
This commit is contained in:
parent
d8d5a627b1
commit
864c18f797
@ -44,7 +44,9 @@ it shall return `-1` and set 'errno' to one of the values defined below.
|
||||
|
||||
ERRORS
|
||||
------
|
||||
No errors are defined.
|
||||
*ENOMEM*::
|
||||
Insufficient storage space is available.
|
||||
|
||||
|
||||
|
||||
EXAMPLE
|
||||
|
@ -74,7 +74,10 @@ int zmq::msg_t::init_data (void *data_, size_t size_, msg_free_fn *ffn_,
|
||||
u.lmsg.type = type_lmsg;
|
||||
u.lmsg.flags = 0;
|
||||
u.lmsg.content = (content_t*) malloc (sizeof (content_t));
|
||||
alloc_assert (u.lmsg.content);
|
||||
if (!u.lmsg.content) {
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
u.lmsg.content->data = data_;
|
||||
u.lmsg.content->size = size_;
|
||||
|
Loading…
x
Reference in New Issue
Block a user