summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2017-02-07 13:29:47 +0100
committerFlorin Coras <florin.coras@gmail.com>2017-02-07 15:43:14 +0000
commit6fa5568fc4b8de0e12a2907de8e1884e984a3520 (patch)
tree8c33dda4d92d35fff20d6054830a68499171d7b5
parenta6bce494e6f2117029e2760d0d15bfd212aca3ec (diff)
Fix M(), M2() macros in VAT
Change-Id: I76593632cde97f7cb80bbc395735404f39f3bd3f Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
-rw-r--r--src/vlibapi/vat_helper_macros.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vlibapi/vat_helper_macros.h b/src/vlibapi/vat_helper_macros.h
index 57722338e2a..57ad520be1a 100644
--- a/src/vlibapi/vat_helper_macros.h
+++ b/src/vlibapi/vat_helper_macros.h
@@ -45,29 +45,31 @@ do { \
#define W(ret) \
do { \
f64 timeout = vat_time_now (vam) + 1.0; \
+ ret = -99; \
\
while (vat_time_now (vam) < timeout) { \
if (vam->result_ready == 1) { \
ret = vam->retval; \
+ break; \
} \
vat_suspend (vam->vlib_main, 1e-5); \
} \
- ret = -99; \
} while(0);
/* W2: wait for results, with timeout */
#define W2(ret, body) \
do { \
f64 timeout = vat_time_now (vam) + 1.0; \
+ ret = -99; \
\
while (vat_time_now (vam) < timeout) { \
if (vam->result_ready == 1) { \
(body); \
ret = vam->retval; \
+ break; \
} \
vat_suspend (vam->vlib_main, 1e-5); \
} \
- ret = -99; \
} while(0);