summaryrefslogtreecommitdiff
path: root/pcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcap.c')
-rw-r--r--pcap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pcap.c b/pcap.c
index 6e012da3..04aa7441 100644
--- a/pcap.c
+++ b/pcap.c
@@ -65,6 +65,8 @@ struct rtentry; /* declarations in <net/if.h> */
#include "diag-control.h"
+#include "thread-local.h"
+
#ifdef HAVE_OS_PROTO_H
#include "os-proto.h"
#endif
@@ -3394,7 +3396,7 @@ pcap_datalink_val_to_description(int dlt)
const char *
pcap_datalink_val_to_description_or_dlt(int dlt)
{
- static char unkbuf[40];
+ static thread_local char unkbuf[40];
const char *description;
description = pcap_datalink_val_to_description(dlt);
@@ -3660,7 +3662,7 @@ pcap_setnonblock_fd(pcap_t *p, int nonblock)
const char *
pcap_statustostr(int errnum)
{
- static char ebuf[15+10+1];
+ static thread_local char ebuf[15+10+1];
switch (errnum) {
@@ -3721,7 +3723,7 @@ pcap_strerror(int errnum)
{
#ifdef HAVE_STRERROR
#ifdef _WIN32
- static char errbuf[PCAP_ERRBUF_SIZE];
+ static thread_local char errbuf[PCAP_ERRBUF_SIZE];
errno_t err = strerror_s(errbuf, PCAP_ERRBUF_SIZE, errnum);
if (err != 0) /* err = 0 if successful */
@@ -3733,7 +3735,7 @@ pcap_strerror(int errnum)
#else
extern int sys_nerr;
extern const char *const sys_errlist[];
- static char errbuf[PCAP_ERRBUF_SIZE];
+ static thread_local char errbuf[PCAP_ERRBUF_SIZE];
if ((unsigned int)errnum < sys_nerr)
return ((char *)sys_errlist[errnum]);