From: Thomas Graf Date: Thu, 18 Nov 2010 13:16:33 +0000 (+0100) Subject: Inherit return code of NL_CB_MSG_OUT in nl_sendmsg() X-Git-Tag: libnl3_0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a08c8ff4cf9573f307ef2843d2a44f1f0a14980;p=thirdparty%2Flibnl.git Inherit return code of NL_CB_MSG_OUT in nl_sendmsg() If NL_CB_MSG_OUT() returns anything != NL_OK, return that value to let any caller of nl_sendmsg() know that the message has not been sent. --- diff --git a/lib/nl.c b/lib/nl.c index cd6e6c7..4e09b9e 100644 --- a/lib/nl.c +++ b/lib/nl.c @@ -211,8 +211,8 @@ int nl_sendmsg(struct nl_sock *sk, struct nl_msg *msg, struct msghdr *hdr) cb = sk->s_cb; if (cb->cb_set[NL_CB_MSG_OUT]) - if (nl_cb_call(cb, NL_CB_MSG_OUT, msg) != NL_OK) - return 0; + if ((ret = nl_cb_call(cb, NL_CB_MSG_OUT, msg)) != NL_OK) + return ret; ret = sendmsg(sk->s_fd, hdr, 0); if (ret < 0)