diff options
author | guy <guy> | 2004-10-19 07:06:11 +0000 |
---|---|---|
committer | guy <guy> | 2004-10-19 07:06:11 +0000 |
commit | e5aebee6d80c8909048dc1ce865e9adb97d94fd7 (patch) | |
tree | 77b64a0b8528dc128ac9f7c319e58a2b3ca8b565 /pcap-snit.c | |
parent | 4b1ac36c836ee326f778742bc28dd3b374702281 (diff) |
Add a "pcap_close_common()" routine which can be used as the close
routine for some pcap-XXX.c files and can be called by the close routine
in other pcap-XXX.c files.
Diffstat (limited to 'pcap-snit.c')
-rw-r--r-- | pcap-snit.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/pcap-snit.c b/pcap-snit.c index 3b0801ed..447f343f 100644 --- a/pcap-snit.c +++ b/pcap-snit.c @@ -25,7 +25,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.71 2004-03-23 19:18:06 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.72 2004-10-19 07:06:13 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -261,15 +261,6 @@ nit_setflags(int fd, int promisc, int to_ms, char *ebuf) return (0); } -static void -pcap_close_snit(pcap_t *p) -{ - if (p->buffer != NULL) - free(p->buffer); - if (p->fd >= 0) - close(p->fd); -} - pcap_t * pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, char *ebuf) @@ -410,7 +401,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, p->getnonblock_op = pcap_getnonblock_fd; p->setnonblock_op = pcap_setnonblock_fd; p->stats_op = pcap_stats_snit; - p->close_op = pcap_close_snit; + p->close_op = pcap_close_common; return (p); bad: |