From: Michal Sojka Date: Sat, 28 Nov 2009 18:57:17 +0000 (+0100) Subject: Handle errors correctly in fwp_send_async() X-Git-Url: http://rtime.felk.cvut.cz/gitweb/frescor/fwp.git/commitdiff_plain/da7d8d49850eae2f11d98925f4439da16c04f943 Handle errors correctly in fwp_send_async() --- diff --git a/fwp/lib/fwp/fwp_endpoint.c b/fwp/lib/fwp/fwp_endpoint.c index fb91688..6117d6c 100644 --- a/fwp/lib/fwp/fwp_endpoint.c +++ b/fwp/lib/fwp/fwp_endpoint.c @@ -635,9 +635,10 @@ int fwp_send_async(struct fwp_endpoint *ep, const void *msg, size_t size) if (!ep->vres) return FRSH_ERR_NOT_BOUND; - if (fwp_vres_consume_budget(ep->vres, size, false) == 0) + ret = fwp_vres_consume_budget(ep->vres, size, false); + if (ret == 0) ret = fwp_endpoint_do_send(ep, msg, size); - else + else if (ret == 1) ret = fwp_vres_enqueue(ep->vres, ep, msg, size); return ret; }