aboutsummaryrefslogtreecommitdiffstats
path: root/ui/export_pdu_ui_utils.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-17 18:58:55 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-18 01:59:32 +0000
commite34d76942c15f9d9e83d078aca950a29452d0b60 (patch)
tree06e994ab1593a5d28f3e7d14c5eff4859d4fba31 /ui/export_pdu_ui_utils.c
parent4ce54674b3c8d3782a744718646ddd0104b45e68 (diff)
Have a commont "capture file open alert box" routine.
Take cf_open_failure_alert_box() and put it into libui, with the name cfile_open_failure_alert_box(). Use it not only in file.c but also in ui/export_pdu_ui_utils.c, where the error we get back isn't necessarily an errno. Change-Id: Ia053f3e403ba464d446bd9530778d5ed302796d2 Reviewed-on: https://code.wireshark.org/review/21174 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/export_pdu_ui_utils.c')
-rw-r--r--ui/export_pdu_ui_utils.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/export_pdu_ui_utils.c b/ui/export_pdu_ui_utils.c
index 133e511df8..0f2ee8d4b1 100644
--- a/ui/export_pdu_ui_utils.c
+++ b/ui/export_pdu_ui_utils.c
@@ -46,17 +46,20 @@ static void
exp_pdu_file_open(exp_pdu_t *exp_pdu_tap_data)
{
int import_file_fd;
- char *tmpname, *capfile_name;
+ char *tmpname, *capfile_name, *comment;
int err;
/* Choose a random name for the temporary import buffer */
import_file_fd = create_tempfile(&tmpname, "Wireshark_PDU_", NULL);
capfile_name = g_strdup(tmpname);
- err = exp_pdu_open(exp_pdu_tap_data, import_file_fd,
- g_strdup_printf("Dump of PDUs from %s", cfile.filename));
+ comment = g_strdup_printf("Dump of PDUs from %s", cfile.filename);
+ err = exp_pdu_open(exp_pdu_tap_data, import_file_fd, comment);
if (err != 0) {
- open_failure_alert_box(capfile_name ? capfile_name : "temporary file", err, TRUE);
+ g_free(comment);
+ cfile_open_failure_alert_box(capfile_name ? capfile_name : "temporary file",
+ err, NULL, TRUE,
+ WTAP_FILE_TYPE_SUBTYPE_PCAPNG);
goto end;
}