aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/merge.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-10-13 18:48:46 -0700
committerGuy Harris <gharris@sonic.net>2020-10-14 04:51:45 +0000
commit6e6233521aa4f0e82b79219cb7e32912012d9ccf (patch)
tree1836305bf265c1aff78d61677343f3fa23bc2aac /wiretap/merge.c
parent92e1b110f3f70d295adb10ce0dc5fad9a7189912 (diff)
Have WTAP_ERR_INTERNAL include an err_info string giving details.
That way, users won't just see "You got an internal error", the details will be given, so they can report them in a bug.
Diffstat (limited to 'wiretap/merge.c')
-rw-r--r--wiretap/merge.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/wiretap/merge.c b/wiretap/merge.c
index 51d15a5bb9..6aae6a6548 100644
--- a/wiretap/merge.c
+++ b/wiretap/merge.c
@@ -946,7 +946,7 @@ merge_process_packets(wtap_dumper *pdh, const int file_type,
cb->callback_func(MERGE_EVENT_DONE, count, in_files, in_file_count, cb->data);
if (status == MERGE_OK || status == MERGE_USER_ABORTED) {
- if (!wtap_dump_close(pdh, err))
+ if (!wtap_dump_close(pdh, err, err_info))
status = MERGE_ERR_CANT_CLOSE_OUTFILE;
} else {
/*
@@ -956,7 +956,9 @@ merge_process_packets(wtap_dumper *pdh, const int file_type,
* Don't overwrite the earlier error.
*/
int close_err = 0;
- (void)wtap_dump_close(pdh, &close_err);
+ gchar *close_err_info = NULL;
+ (void)wtap_dump_close(pdh, &close_err, &close_err_info);
+ g_free(close_err_info);
}
/* Close the input files after the output file in case the latter still
@@ -1050,12 +1052,15 @@ merge_files_common(const gchar* out_filename, /* normal output mode */
params.dsbs_growing = dsb_combined;
}
if (out_filename) {
- pdh = wtap_dump_open(out_filename, file_type, WTAP_UNCOMPRESSED, &params, err);
+ pdh = wtap_dump_open(out_filename, file_type, WTAP_UNCOMPRESSED,
+ &params, err, err_info);
} else if (out_filenamep) {
pdh = wtap_dump_open_tempfile(out_filenamep, pfx, file_type,
- WTAP_UNCOMPRESSED, &params, err);
+ WTAP_UNCOMPRESSED, &params, err,
+ err_info);
} else {
- pdh = wtap_dump_open_stdout(file_type, WTAP_UNCOMPRESSED, &params, err);
+ pdh = wtap_dump_open_stdout(file_type, WTAP_UNCOMPRESSED, &params, err,
+ err_info);
}
if (pdh == NULL) {
merge_close_in_files(in_file_count, in_files);