aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--capture.c5
-rw-r--r--capture.h5
-rw-r--r--capture_sync.c4
-rw-r--r--tshark.c10
4 files changed, 17 insertions, 7 deletions
diff --git a/capture.c b/capture.c
index ad3bb3458b..5e808f95eb 100644
--- a/capture.c
+++ b/capture.c
@@ -510,7 +510,7 @@ capture_input_cfilter_error_message(capture_options *capture_opts, char *error_m
/* capture child closed its side of the pipe, do the required cleanup */
void
-capture_input_closed(capture_options *capture_opts)
+capture_input_closed(capture_options *capture_opts, gchar *msg)
{
int err;
int packet_count_save;
@@ -518,6 +518,9 @@ capture_input_closed(capture_options *capture_opts)
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture stopped!");
g_assert(capture_opts->state == CAPTURE_PREPARING || capture_opts->state == CAPTURE_RUNNING);
+ if (msg != NULL)
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", msg);
+
/* if we didn't start the capture, do a fake start. */
/* (happens if we got an error message - we won't get a filename then). */
if(capture_opts->state == CAPTURE_PREPARING) {
diff --git a/capture.h b/capture.h
index f3107fc013..b047d46980 100644
--- a/capture.h
+++ b/capture.h
@@ -97,9 +97,10 @@ extern void capture_input_error_message(capture_options *capture_opts, char *err
extern void capture_input_cfilter_error_message(capture_options *capture_opts, char *error_message);
/**
- * Capture child closed its side of the pipe, do the required cleanup.
+ * Capture child closed its side of the pipe, report any error and
+ * do the required cleanup.
*/
-extern void capture_input_closed(capture_options *capture_opts);
+extern void capture_input_closed(capture_options *capture_opts, gchar *msg);
struct if_stat_cache_s;
typedef struct if_stat_cache_s if_stat_cache_t;
diff --git a/capture_sync.c b/capture_sync.c
index a66aff4b18..6e4d052c8a 100644
--- a/capture_sync.c
+++ b/capture_sync.c
@@ -1434,7 +1434,6 @@ sync_pipe_input_cb(gint source, gpointer user_data)
else
primary_msg = g_strdup("Error reading from sync pipe");
}
- g_free(primary_msg); /* XXX - display this */
/* No more child process. */
capture_opts->fork_child = -1;
@@ -1442,7 +1441,8 @@ sync_pipe_input_cb(gint source, gpointer user_data)
#ifdef _WIN32
ws_close(capture_opts->signal_pipe_write_fd);
#endif
- capture_input_closed(capture_opts);
+ capture_input_closed(capture_opts, primary_msg);
+ g_free(primary_msg);
return FALSE;
}
diff --git a/tshark.c b/tshark.c
index b51b98b9cb..aa0f9ef098 100644
--- a/tshark.c
+++ b/tshark.c
@@ -2179,10 +2179,16 @@ capture_input_drops(capture_options *capture_opts _U_, guint32 dropped)
}
-/* capture child closed its side of the pipe, do the required cleanup */
+/*
+ * Capture child closed its side of the pipe, report any error and
+ * do the required cleanup.
+ */
void
-capture_input_closed(capture_options *capture_opts)
+capture_input_closed(capture_options *capture_opts, gchar *msg)
{
+ if (msg != NULL)
+ fprintf(stderr, "tshark: %s\n", msg);
+
report_counts();
if(capture_opts->cf != NULL && ((capture_file *) capture_opts->cf)->wth != NULL) {