aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorOrgad Shaneh <orgads@gmail.com>2017-11-08 13:50:33 +0200
committerDario Lombardo <lomato@gmail.com>2017-11-08 15:00:04 +0000
commit8730b2037a6a999af28594607a4c27c3837f8f83 (patch)
treea6464f45564d0c5b79434306f03cec8876753933 /tshark.c
parent2125275c7cc261e101731162ac1eeba7626ce9e8 (diff)
tshark/tfshark: Replace global prefs with a boolean
This partially reverts dc0e6ccc9f9aaad7139c1edd3b723c4b939b15da in favor of a cleaner solution. Change-Id: Ie57329020b5a7d15eb7d99aad3103843a14f07a6 Reviewed-on: https://code.wireshark.org/review/24278 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tshark.c b/tshark.c
index 409a858862..ce2034ef9b 100644
--- a/tshark.c
+++ b/tshark.c
@@ -214,6 +214,8 @@ static proto_node_children_grouper_func node_children_grouper = proto_node_group
/* The line separator used between packets, changeable via the -S option */
static const char *separator = "";
+static gboolean prefs_loaded = FALSE;
+
#ifdef HAVE_LIBPCAP
/*
* TRUE if we're to print packet counts to keep track of captured packets.
@@ -224,8 +226,6 @@ static capture_options global_capture_opts;
static capture_session global_capture_session;
static info_data_t global_info_data;
-static e_prefs *prefs_p = NULL;
-
#ifdef SIGINFO
static gboolean infodelay; /* if TRUE, don't print capture info in SIGINFO handler */
static gboolean infoprint; /* if TRUE, print capture info after clearing infodelay */
@@ -526,7 +526,7 @@ tshark_log_handler (const gchar *log_domain, GLogLevelFlags log_level,
ERROR and CRITICAL level messages so the current code is a behavioral
change. The current behavior is the same as in Wireshark.
*/
- if (prefs_p && (log_level & G_LOG_LEVEL_MASK & prefs.console_log_level) == 0) {
+ if (prefs_loaded && (log_level & G_LOG_LEVEL_MASK & prefs.console_log_level) == 0) {
return;
}
@@ -718,6 +718,7 @@ main(int argc, char *argv[])
dfilter_t *rfcode = NULL;
dfilter_t *dfcode = NULL;
gchar *err_msg;
+ e_prefs *prefs_p;
int log_flags;
gchar *output_only = NULL;
gchar *volatile pdu_export_arg = NULL;
@@ -1029,6 +1030,7 @@ main(int argc, char *argv[])
/* Load libwireshark settings from the current profile. */
prefs_p = epan_load_settings();
+ prefs_loaded = TRUE;
read_filter_list(CFILTER_LIST);