Use pcap_perror where applicable
This commit is contained in:
parent
0179e419dc
commit
6934d97a3b
1 changed files with 2 additions and 2 deletions
|
@ -297,13 +297,13 @@ struct ethsock *ethsock_create(const char *intf, uint16_t protocol)
|
||||||
#ifndef NMRPFLASH_WINDOWS
|
#ifndef NMRPFLASH_WINDOWS
|
||||||
sock->fd = pcap_get_selectable_fd(sock->pcap);
|
sock->fd = pcap_get_selectable_fd(sock->pcap);
|
||||||
if (sock->fd == -1) {
|
if (sock->fd == -1) {
|
||||||
fprintf(stderr, "No selectable file descriptor available.\n");
|
pcap_perror(sock->pcap, "pcap_get_selectable_fd");
|
||||||
goto cleanup_pcap;
|
goto cleanup_pcap;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
sock->handle = pcap_getevent(sock->pcap);
|
sock->handle = pcap_getevent(sock->pcap);
|
||||||
if (!sock->handle) {
|
if (!sock->handle) {
|
||||||
fprintf(stderr, "No event handle available.\n");
|
pcap_perror(sock->pcap, "pcap_getevent");
|
||||||
goto cleanup_pcap;
|
goto cleanup_pcap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue