aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/libpcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-09-17 07:50:35 +0000
committerGuy Harris <guy@alum.mit.edu>2000-09-17 07:50:35 +0000
commit726da14b057c5a1f2362a71b9adb5cbfd6624232 (patch)
tree42c3d33f46bdea3c4f4dd8b6bed82019081a4f85 /wiretap/libpcap.c
parentb3bffc47419f9005b20089b172cd63a2811f8524 (diff)
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
Diffstat (limited to 'wiretap/libpcap.c')
-rw-r--r--wiretap/libpcap.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c
index b19c76dfcc..173548fddf 100644
--- a/wiretap/libpcap.c
+++ b/wiretap/libpcap.c
@@ -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;
}