If primary process exits, then it is not possible (or needed)
to cleanup resources. Instead just exit after closing the
capture file.

Bugzilla ID: 1760
Fixes: a99a311ba101 ("app/pdump: exit with primary process")
Cc: sta...@dpdk.org

Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
---
 app/pdump/main.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/app/pdump/main.c b/app/pdump/main.c
index fa85859703..1741d7e709 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -1028,13 +1028,15 @@ main(int argc, char **argv)
        dump_packets();
 
        disable_primary_monitor();
-       cleanup_pdump_resources();
+
        /* dump debug stats */
        print_pdump_stats();
 
-       ret = rte_eal_cleanup();
-       if (ret)
-               printf("Error from rte_eal_cleanup(), %d\n", ret);
+       /* If primary has exited, do not try and communicate with it */
+       if (!rte_eal_primary_proc_alive(NULL))
+               return 0;
 
-       return 0;
+       cleanup_pdump_resources();
+
+       return rte_eal_cleanup() ? EXIT_FAILURE : 0;
 }
-- 
2.47.2

Reply via email to