summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/client/client.c
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-12-19 18:26:29 -0500
committerOle Tr�an <otroan@employees.org>2021-02-16 00:12:45 +0000
commitbad4766763d5ad80b1296c1455666b2589272044 (patch)
treeb5a64e0ab1bd7436f6e1cadf73a7a3bc311f0038 /src/vpp-api/client/client.c
parentf9db7f0ff51e3c212f70d38c5e4fa68e07b82a96 (diff)
vapi: add dedicated return code for client timeout
Type: refactor Change-Id: I1fbabb743f20e21557c69bdaf97eda6f63584903 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vpp-api/client/client.c')
-rw-r--r--src/vpp-api/client/client.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vpp-api/client/client.c b/src/vpp-api/client/client.c
index 20adc957869..2de880d803b 100644
--- a/src/vpp-api/client/client.c
+++ b/src/vpp-api/client/client.c
@@ -423,12 +423,14 @@ vac_read (char **p, int *l, u16 timeout)
vl_shmem_hdr_t *shmem_hdr;
/* svm_queue_sub(below) returns {-1, -2} */
- if (!pm->connected_to_vlib) return -3;
+ if (!pm->connected_to_vlib)
+ return VAC_NOT_CONNECTED;
*l = 0;
/* svm_queue_sub(below) returns {-1, -2} */
- if (am->our_pid == 0) return (-4);
+ if (am->our_pid == 0)
+ return (VAC_SHM_NOT_READY);
/* Poke timeout thread */
if (timeout)
@@ -492,7 +494,7 @@ vac_read (char **p, int *l, u16 timeout)
vl_msg_api_free((void *) msg);
/* Client might forget to resume RX thread on failure */
vac_rx_resume ();
- return -1;
+ return VAC_TIMEOUT;
}
/*
@@ -518,7 +520,8 @@ vac_write (char *p, int l)
svm_queue_t *q;
vac_main_t *pm = &vac_main;
- if (!pm->connected_to_vlib) return -1;
+ if (!pm->connected_to_vlib)
+ return VAC_NOT_CONNECTED;
if (!mp) return (-1);
memcpy(mp, p, l);