aboutsummaryrefslogtreecommitdiffstats
path: root/src/vat
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-10-17 13:13:42 -0400
committerDave Barach <dave@barachs.net>2017-10-17 15:19:22 -0400
commitb9f2cf0bff89ccf5c88072213a25efb65fb5516e (patch)
tree1f34f55543b5dfeaf5edd199ca7587121188534a /src/vat
parenta3db0782d4c069733fa2e3ac1763efd4499b1de7 (diff)
VPP-1032: fix coverity warnings
Change-Id: Ic3a0c51e5408921051deaf2e50372d9654574b27 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vat')
-rw-r--r--src/vat/api_format.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/vat/api_format.c b/src/vat/api_format.c
index e7382c29720..24b6fb06a3a 100644
--- a/src/vat/api_format.c
+++ b/src/vat/api_format.c
@@ -2137,6 +2137,7 @@ static void vl_api_memfd_segment_create_reply_t_handler
vam->client_index_invalid = 1;
+ /* Note: this closes memfd.fd */
retval = memfd_slave_init (&memfd);
if (retval)
clib_warning ("WARNING: segment map returned %d", retval);
@@ -2152,8 +2153,6 @@ static void vl_api_memfd_segment_create_reply_t_handler
vl_client_connect_to_vlib_no_map ("pvt",
"vpp_api_test(p)",
32 /* input_queue_length */ );
- if (close (my_fd) < 0)
- clib_unix_warning ("close memfd fd pivot");
vam->vl_input_queue = am->shmem_hdr->vl_input_queue;
vl_socket_client_enable_disable (&vam->socket_client_main,
@@ -20918,16 +20917,12 @@ api_app_namespace_add_del (vat_main_t * vam)
static int
api_memfd_segment_create (vat_main_t * vam)
{
+#if VPP_API_TEST_BUILTIN == 0
unformat_input_t *i = vam->input;
vl_api_memfd_segment_create_t *mp;
u64 size = 64 << 20;
int ret;
-#if VPP_API_TEST_BUILTIN == 1
- errmsg ("memfd_segment_create (builtin) not supported");
- return -99;
-#endif
-
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
if (unformat (i, "size %U", unformat_memory_size, &size))
@@ -20941,6 +20936,11 @@ api_memfd_segment_create (vat_main_t * vam)
S (mp);
W (ret);
return ret;
+
+#else
+ errmsg ("memfd_segment_create (builtin) not supported");
+ return -99;
+#endif
}
static int