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>
*/
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