Close the handle for the SNMP library after we're done with it - shared

objects are reference-counted so that won't make it disappear if
Ethereal is also linked with it as a shared SNMP library.

svn path=/trunk/; revision=2444
This commit is contained in:
Guy Harris 2000-09-17 07:50:35 +00:00
parent b3bffc4741
commit 726da14b05
1 changed files with 11 additions and 7 deletions

View File

@ -1,6 +1,6 @@
/* libpcap.c
*
* $Id: libpcap.c,v 1.41 2000/09/15 07:52:42 guy Exp $
* $Id: libpcap.c,v 1.42 2000/09/17 07:50:35 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@ -572,11 +572,13 @@ static libpcap_try_t libpcap_try(wtap *wth, int *err)
* Attempt to read the first record's header.
*/
if (libpcap_read_header(wth, err, &first_rec_hdr, TRUE) == -1) {
if (*err == WTAP_ERR_SHORT_READ) {
if (*err == 0 || *err == WTAP_ERR_SHORT_READ) {
/*
* Short read - assume the file is in this format.
* EOF or short read - assume the file is in this
* format.
* When our client tries to read the first packet
* they will presumably get the same short read.
* they will presumably get the same EOF or short
* read.
*/
return THIS_FORMAT;
}
@ -608,11 +610,13 @@ static libpcap_try_t libpcap_try(wtap *wth, int *err)
* Now attempt to read the second record's header.
*/
if (libpcap_read_header(wth, err, &second_rec_hdr, TRUE) == -1) {
if (*err == WTAP_ERR_SHORT_READ) {
if (*err == 0 || *err == WTAP_ERR_SHORT_READ) {
/*
* Short read - assume the file is in this format.
* EOF or short read - assume the file is in this
* format.
* When our client tries to read the second packet
* they will presumably get the same short read.
* they will presumably get the same EOF or short
* read.
*/
return THIS_FORMAT;
}