aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/vms.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-01-03 09:17:20 +0000
committerGuy Harris <guy@alum.mit.edu>2011-01-03 09:17:20 +0000
commita22e640a8dd1c5b7e52df2192c240e8eb6fede3c (patch)
treee418333dac795f66ce754b4d2407910a3d3d8450 /wiretap/vms.c
parentf780211ade9c27dea43b147ee02d6453c4a1d1ae (diff)
We must always return an error code on an error; otherwise, our caller
will see random crap as the error code. However, if we're skipping a "TCPIPTRACE-W-BUFFERSFUL" error, if the "error" we get is an end-of-file indication, that's *not* an error. It is, however, ultimately a "we dropped some packets" indication; add a comment noting that we should eventually treat it as such. svn path=/trunk/; revision=35337
Diffstat (limited to 'wiretap/vms.c')
-rw-r--r--wiretap/vms.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/wiretap/vms.c b/wiretap/vms.c
index d24d1310f4..efc1f9eba6 100644
--- a/wiretap/vms.c
+++ b/wiretap/vms.c
@@ -289,8 +289,10 @@ static gboolean vms_read(wtap *wth, int *err, gchar **err_info,
#else
offset = file_tell(wth->fh);
#endif
- if (offset < 1)
+ if (offset < 1) {
+ *err = file_error(wth->fh);
return FALSE;
+ }
/* Parse the header */
pkt_len = parse_vms_rec_hdr(wth, wth->fh, err, err_info);
@@ -488,9 +490,20 @@ parse_vms_hex_dump(FILE_T fh, int pkt_len, guint8* buf, int *err,
}
}
/* Avoid TCPIPTRACE-W-BUFFERSFUL, TCPIPtrace could not save n packets.
- * errors. */
- if (!file_gets(line, VMS_LINE_LENGTH, fh))
+ * errors.
+ *
+ * XXX - when we support packet drop report information in the
+ * Wiretap API, we should parse those lines and return "n" as
+ * a packet drop count. */
+ if (!file_gets(line, VMS_LINE_LENGTH, fh)) {
+ *err = file_error(fh);
+ if (*err == 0) {
+ /* There is no next line, so there's no "TCPIPtrace could not
+ * save n packets" line; not an error. */
+ return TRUE;
+ }
return FALSE;
+ }
return TRUE;
}