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
This commit is contained in:
parent
0bc06ee3ab
commit
8f8eeb5dce
13
file.c
13
file.c
|
@ -1548,11 +1548,18 @@ cf_merge_files(char **out_filenamep, int in_file_count,
|
|||
destroy_progress_dlg(progbar);
|
||||
|
||||
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) {
|
||||
/*
|
||||
|
|
13
mergecap.c
13
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) {
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue