From 23d80b00122984535e47e5e2af8cbd4deb9b8a9e Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 19 Dec 2016 10:54:50 -0800 Subject: 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 --- caputils/capture-pcap-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'caputils') 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 -- cgit v1.2.1