/* Close pcap device. Not called for offline captures.  */
static void pcap_cleanup_dos(pcap_t *p)
/* Close pcap device. Not called for offline captures.  */
static void pcap_cleanup_dos(pcap_t *p)
{
  struct pcap_dos *pd;
  if (!exc_occured)
  {
    pd = p->priv;
    if (pcap_stats(p,NULL) < 0)
       pd->stat.ps_drop = 0;
    if (!get_device(p->fd))
       return;
    handle_to_device [p->fd-1] = NULL;
    p->fd = 0;
    if (ref_count > 0)
        ref_count--;
    if (ref_count > 0)
       return;
  }
  close_driver();
}