Use pcap_perror where applicable
authorJoseph C. Lehner <joseph.c.lehner@gmail.com>
Sat, 19 Mar 2016 15:26:19 +0000 (16:26 +0100)
committerJoseph C. Lehner <joseph.c.lehner@gmail.com>
Sat, 19 Mar 2016 15:26:19 +0000 (16:26 +0100)
ethsock.c

index 8f970e1d458e9aa980a82a723ffec8c271d12f41..4bef279d660d3937cd7501c49cb6e9e1c504ceb3 100644 (file)
--- 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;
        }