summaryrefslogtreecommitdiff
path: root/mergecap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-01-21 08:50:35 +0000
committerGuy Harris <guy@alum.mit.edu>2014-01-21 08:50:35 +0000
commit8f8eeb5dcea62a1d4dd27cec193756844fe12c43 (patch)
treee198ef27d769106c3b6ae42eef5b28030406c61b /mergecap.c
parent0bc06ee3ab5ddc3bf00a97be4444b2a5d5f56385 (diff)
downloadwireshark-8f8eeb5dcea62a1d4dd27cec193756844fe12c43.tar.gz
Check the return of wtap_dump_close() even if we've gotten a read error;
the only reason not to check it is if we've already gotten a write error and another write error would be superfluous (either "you got two of the same error" or "you got an I/O error *and* you ran out of disk space/disk quota" is of limited interest). Discard the return value of wtap_dump_close() in the case where we've already gotten a write error, in the hopes of squelching a Coverity warning. svn path=/trunk/; revision=54872
Diffstat (limited to 'mergecap.c')
-rw-r--r--mergecap.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/mergecap.c b/mergecap.c
index 054fdb4ed4..a317c4a307 100644
--- a/mergecap.c
+++ b/mergecap.c
@@ -468,11 +468,18 @@ main(int argc, char *argv[])
}
merge_close_in_files(in_file_count, in_files);
- if (!got_read_error && !got_write_error) {
+ if (!got_write_error) {
if (!wtap_dump_close(pdh, &write_err))
got_write_error = TRUE;
- } else
- wtap_dump_close(pdh, &close_err);
+ } else {
+ /*
+ * We already got a write error; no need to report another
+ * write error on close.
+ *
+ * Don't overwrite the earlier write error.
+ */
+ (void)wtap_dump_close(pdh, &close_err);
+ }
if (got_read_error) {
/*