From 1fdc0f4a6f47b62a2330d676c1ed179d4cc08f2f Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Fri, 19 Oct 2018 17:07:14 +0200 Subject: tshark: replace exit with abort in TRY/CATCH. Change-Id: I3fe6c63fcf179fd10b0b722b2749c68365eb0870 Reviewed-on: https://code.wireshark.org/review/30258 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu --- tshark.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tshark.c') diff --git a/tshark.c b/tshark.c index 387845d66f..8aeca144fd 100644 --- a/tshark.c +++ b/tshark.c @@ -2420,7 +2420,7 @@ tshark_epan_new(capture_file *cf) static gboolean capture(void) { - gboolean ret; + volatile gboolean ret = TRUE; guint i; GString *str; #ifdef USE_TSHARK_SELECT @@ -2532,13 +2532,15 @@ capture(void) if (ret == -1) { fprintf(stderr, "%s: %s\n", "select()", g_strerror(errno)); - return TRUE; + ret = TRUE; + loop_running = FALSE; } else if (ret == 1) { #endif /* Call the real handler */ if (!pipe_input.input_cb(pipe_input.source, pipe_input.user_data)) { g_log(NULL, G_LOG_LEVEL_DEBUG, "input pipe closed"); - return FALSE; + ret = FALSE; + loop_running = FALSE; } #ifdef USE_TSHARK_SELECT } @@ -2553,10 +2555,10 @@ capture(void) "\n" "More information and workarounds can be found at\n" "https://wiki.wireshark.org/KnownBugs/OutOfMemory\n"); - exit(1); + abort(); } ENDTRY; - return TRUE; + return ret; } /* capture child detected an error */ -- cgit v1.2.3