From: Joseph C. Lehner Date: Sat, 19 Mar 2016 15:26:19 +0000 (+0100) Subject: Use pcap_perror where applicable X-Git-Tag: v0.9.4~5^2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6934d97a3bb9d3a85015279b894d1e3985aa43af;p=oweals%2Fnmrpflash.git Use pcap_perror where applicable --- diff --git a/ethsock.c b/ethsock.c index 8f970e1..4bef279 100644 --- a/ethsock.c +++ b/ethsock.c @@ -297,13 +297,13 @@ struct ethsock *ethsock_create(const char *intf, uint16_t protocol) #ifndef NMRPFLASH_WINDOWS sock->fd = pcap_get_selectable_fd(sock->pcap); if (sock->fd == -1) { - fprintf(stderr, "No selectable file descriptor available.\n"); + pcap_perror(sock->pcap, "pcap_get_selectable_fd"); goto cleanup_pcap; } #else sock->handle = pcap_getevent(sock->pcap); if (!sock->handle) { - fprintf(stderr, "No event handle available.\n"); + pcap_perror(sock->pcap, "pcap_getevent"); goto cleanup_pcap; }