#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.116.2.10 2008-04-10 00:50:54 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.116.2.11 2008-04-14 20:41:51 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif /* HAVE_SOLARIS */
static void
-pcap_close_dlpi(pcap_t *p)
+pcap_cleanup_dlpi(pcap_t *p)
{
- pcap_close_common(p);
- if (p->send_fd >= 0)
+ if (p->send_fd >= 0) {
close(p->send_fd);
+ p->send_fd = -1;
+ }
+ pcap_cleanup_live_common(p);
}
static int
#endif
int status = PCAP_ERROR;
- p->fd = -1; /* indicate that it hasn't been opened yet */
- p->send_fd = -1;
-
#ifdef HAVE_DEV_DLPI
/*
** Remove any "/dev/" on the front of the device.
p->getnonblock_op = pcap_getnonblock_fd;
p->setnonblock_op = pcap_setnonblock_fd;
p->stats_op = pcap_stats_dlpi;
- p->close_op = pcap_close_dlpi;
+ p->cleanup_op = pcap_cleanup_dlpi;
return (status);
bad:
- if (p->fd >= 0)
- close(p->fd);
- if (p->send_fd >= 0)
- close(p->send_fd);
+ pcap_cleanup_dlpi(p);
return (status);
}
if (p == NULL)
return (NULL);
+ p->send_fd = -1; /* it hasn't been opened yet */
+
p->activate_op = pcap_activate_dlpi;
return (p);
}