msantos / epcap

Erlang packet capture interface using pcap
http://listincomprehension.com/2009/12/erlang-packet-sniffer-using-ei-and.html
BSD 3-Clause "New" or "Revised" License
178 stars 56 forks source link

Fix strtonum error handling #31

Closed erlbeck closed 3 years ago

erlbeck commented 3 years ago

The epcap command failed on a single FreeBSD12 installation (Jenkins build host) with no obvious indication about the error. It turned out that the errno variable was non-zero initially causing the first numeric option to report an error. This PR changes the error check to use the errstrp parameter to decide whether to abort. It also adds calls to display error messages in these cases.

nifoc commented 3 years ago

I just ran into the same issue (FreeBSD 13 host with a 12.0 jail) and came to the same conclusion. Thankfully I checked the PRs before spending too much time trying to fix it myself.

@msantos Can we get this merged?

msantos commented 3 years ago

@erlbeck @nifoc apologies again for the slow response. I fixed the conflict with the timeout changes and merged, thank you for the patch!