summaryrefslogtreecommitdiff
path: root/caputils
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-12-19 10:54:50 -0800
committerGuy Harris <guy@alum.mit.edu>2016-12-19 18:55:59 +0000
commit23d80b00122984535e47e5e2af8cbd4deb9b8a9e (patch)
tree18586c8ad63e838fe6bffc5344f5a66eefff0bc6 /caputils
parentd7ce60bb080eb22808ccf304ebc400da866bae0b (diff)
downloadwireshark-23d80b00122984535e47e5e2af8cbd4deb9b8a9e.tar.gz
Don't use PCAP_ERROR if it's not known to be defined.
The introduction of pcap_list_datalinks() predates the introduction of PCAP_ERROR, so the presence of pcap_list_datalinks() doesn't guarantee that PCAP_ERROR is defined. Change the use of PCAP_ERROR when checking the result of pcap_list_datalinks() to just check for -1. Change-Id: Id8229b7aebd02eaf3701983f9343503397af4fb3 Reviewed-on: https://code.wireshark.org/review/19351 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'caputils')
-rw-r--r--caputils/capture-pcap-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/caputils/capture-pcap-util.c b/caputils/capture-pcap-util.c
index a41b7668d5..b8b71e3bb5 100644
--- a/caputils/capture-pcap-util.c
+++ b/caputils/capture-pcap-util.c
@@ -890,7 +890,7 @@ get_data_link_types(pcap_t *pch, interface_options *interface_opts,
*/
pcap_close(pch);
if (err_str != NULL) {
- if (nlt == PCAP_ERROR)
+ if (nlt == -1)
*err_str = g_strdup_printf("pcap_list_datalinks() failed: %s",
pcap_geterr(pch));
else