Fix crashiness on OS X when the network device couldn't be opened (nw)

This commit is contained in:
arbee 2018-11-22 17:30:42 -05:00
parent d946cc802e
commit f1c9b0a8f5

View File

@ -217,6 +217,9 @@ int netdev_pcap::recv_dev(uint8_t **buf)
uint8_t pktbuf[2048];
int ret;
// no device open?
if(!m_p) return 0;
// Empty
if(OSAtomicCompareAndSwapInt(m_ctx.head, m_ctx.tail, &m_ctx.tail)) {
return 0;