From 08d82e98cdf75c810659fcb347e89198cf7b0bc5 Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Thu, 20 Jun 2019 13:46:46 -0400 Subject: api: fix vac_read return codes - vac_read was returning the same code for multiple errors. - Refactor VppTransportShmemIOError to capture rv and description. Type: refactor Change-Id: Ifb8ca5ff679f658bcd92a43ecddaffd2fc18dbd5 Signed-off-by: Paul Vinciguerra --- src/vpp-api/client/client.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/vpp-api/client') diff --git a/src/vpp-api/client/client.c b/src/vpp-api/client/client.c index 5b47fd4dd7d..50d088c1bfb 100644 --- a/src/vpp-api/client/client.c +++ b/src/vpp-api/client/client.c @@ -450,11 +450,13 @@ vac_read (char **p, int *l, u16 timeout) int rv; vl_shmem_hdr_t *shmem_hdr; - if (!pm->connected_to_vlib) return -1; + /* svm_queue_sub(below) returns {-1, -2} */ + if (!pm->connected_to_vlib) return -3; *l = 0; - if (am->our_pid == 0) return (-1); + /* svm_queue_sub(below) returns {-1, -2} */ + if (am->our_pid == 0) return (-4); /* Poke timeout thread */ if (timeout) -- cgit 1.2.3-korg