From 6934d97a3bb9d3a85015279b894d1e3985aa43af Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Sat, 19 Mar 2016 16:26:19 +0100 Subject: [PATCH] Use pcap_perror where applicable --- ethsock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.25.1