diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2019-01-05 19:37:27 -0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2019-01-06 23:59:50 +0000 |
commit | 356824fa3ccd1adb96fe6834458923aa9536517a (patch) | |
tree | 2c37e1b26136fdefd512c39716e4644c4a4d0b16 /src/vpp-api/client/stat_client.c | |
parent | 3c8e14684d32c19529c471a747bc9693a2801335 (diff) |
vpp-api: Add context to VPPStatsIOError.
* Provide context information and return meaningful information.
VPPStatsIOError: Stat segment client connection returned: -2 Stat client socket open but couldn't connect.
Change-Id: I14ea35c58452a2cb7598a7efd136f0c7e1f5743a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vpp-api/client/stat_client.c')
-rw-r--r-- | src/vpp-api/client/stat_client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vpp-api/client/stat_client.c b/src/vpp-api/client/stat_client.c index bb7f240a753..2cf53d5d0af 100644 --- a/src/vpp-api/client/stat_client.c +++ b/src/vpp-api/client/stat_client.c @@ -124,14 +124,14 @@ stat_segment_connect_r (const char *socket_name, stat_client_main_t * sm) 0) { close (sock); - return -1; + return -2; } if ((mfd = recv_fd (sock)) < 0) { close (sock); fprintf (stderr, "Receiving file descriptor failed\n"); - return -1; + return -3; } close (sock); @@ -142,13 +142,13 @@ stat_segment_connect_r (const char *socket_name, stat_client_main_t * sm) if (fstat (mfd, &st) == -1) { perror ("mmap fstat failed"); - return -1; + return -4; } if ((memaddr = mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, mfd, 0)) == MAP_FAILED) { perror ("mmap map failed"); - return -1; + return -5; } sm->memory_size = st.st_size; |