aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-12-24 12:59:47 +0100
committerAnders Broman <a.broman58@gmail.com>2017-12-24 20:22:58 +0000
commitbad83f249fa583e1f26224a9bd7b557f6d790c08 (patch)
tree076737f25d36b118a1d0377f9d1699281fbef47e /dumpcap.c
parent8642d72f36239267c474ef096252dc64ac6fd710 (diff)
Fix build and thread runtime compat with older GLib
CentOS 6 ships with glib 2.28.8 which do not support g_ptr_array_new_full (make-taps/make-dissectors) and need to link with wsutil for glib-compat. g_thread_new was only introduced with GLib 2.32 (not 2.31), so adjust the check accordingly. Abort in case thread creation fails (as documented). Properly initialize threads or it will abort on runtime (this also requires linking epan with gthreads in CMake, autotools already includes it with GLIB_LIBS). Change-Id: Ie81d6df7b3b26aaa4eb25e23719a220755e2c13c Reviewed-on: https://code.wireshark.org/review/24978 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/dumpcap.c b/dumpcap.c
index bebe9195ef..7b4b554940 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -120,6 +120,9 @@
#endif
#endif
+/* for g_thread_new */
+#include "wsutil/glib-compat.h"
+
#ifdef DEBUG_CHILD_DUMPCAP
FILE *debug_log; /* for logging debug messages to */
/* a file if DEBUG_CHILD_DUMPCAP */
@@ -2044,11 +2047,7 @@ pcapng_pipe_open_live(int fd,
}
#ifdef _WIN32
else {
-#if GLIB_CHECK_VERSION(2,31,0)
g_thread_new("cap_pipe_open_live", &cap_thread_read, pcap_src);
-#else
- g_thread_create(&cap_thread_read, pcap_src, FALSE, NULL);
-#endif
bh->block_type = type;
pcap_src->cap_pipe_buf = (char *) &bh->block_total_length;