aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-12-17 16:41:21 -0800
committerGuy Harris <guy@alum.mit.edu>2014-12-18 00:41:43 +0000
commit6011a047d3cd2aba84e7fdd3bf7e8403a2f3563b (patch)
treee65e862bc54c08528399d081c5d4d2df128a2b5d /file.c
parentaa27e665b1d469e54b8cbb9931d5324acdf4dc75 (diff)
WTAP_ERR_UNWRITABLE_ errors aren't returned by reads or open-for-reading.
Check for them *only* on opening for writing and writes. Change-Id: I4b537d511ec04bcfc81f69166a2b9a2ee9310067 Reviewed-on: https://code.wireshark.org/review/5827 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'file.c')
-rw-r--r--file.c38
1 files changed, 2 insertions, 36 deletions
diff --git a/file.c b/file.c
index 597d19942a..757997cb82 100644
--- a/file.c
+++ b/file.c
@@ -747,13 +747,6 @@ cf_read(capture_file *cf, gboolean reloading)
g_free(err_info);
break;
- case WTAP_ERR_UNWRITABLE_ENCAP:
- simple_error_message_box(
- "The capture file has a packet with a network type that Wireshark doesn't support.\n(%s)",
- err_info);
- g_free(err_info);
- break;
-
case WTAP_ERR_SHORT_READ:
simple_error_message_box(
"The capture file appears to have been cut short"
@@ -1526,13 +1519,6 @@ cf_merge_files(char **out_filenamep, int in_file_count,
display_basename = g_filename_display_basename(in_files[i].filename);
switch (read_err) {
- case WTAP_ERR_UNWRITABLE_ENCAP:
- simple_error_message_box(
- "The capture file %s has a packet with a network type that Wireshark doesn't support.\n(%s)",
- display_basename, err_info);
- g_free(err_info);
- break;
-
case WTAP_ERR_SHORT_READ:
simple_error_message_box(
"The capture file %s appears to have been cut short"
@@ -1758,12 +1744,6 @@ cf_read_record_r(capture_file *cf, const frame_data *fdata,
display_basename = g_filename_display_basename(cf->filename);
switch (err) {
- case WTAP_ERR_UNWRITABLE_ENCAP:
- simple_error_message_box("The file \"%s\" has a packet with a network type that Wireshark doesn't support.\n(%s)",
- display_basename, err_info);
- g_free(err_info);
- break;
-
case WTAP_ERR_BAD_FILE:
simple_error_message_box("An error occurred while reading from the file \"%s\": %s.\n(%s)",
display_basename, wtap_strerror(err), err_info);
@@ -4543,13 +4523,6 @@ rescan_file(capture_file *cf, const char *fname, gboolean is_tempfile, int *err)
g_free(err_info);
break;
- case WTAP_ERR_UNWRITABLE_ENCAP:
- simple_error_message_box(
- "The capture file has a packet with a network type that Wireshark doesn't support.\n(%s)",
- err_info);
- g_free(err_info);
- break;
-
case WTAP_ERR_SHORT_READ:
simple_error_message_box(
"The capture file appears to have been cut short"
@@ -5082,15 +5055,8 @@ cf_open_failure_alert_box(const char *filename, int err, gchar *err_info,
break;
case WTAP_ERR_UNWRITABLE_ENCAP:
- if (for_writing) {
- simple_error_message_box("Wireshark can't save this capture in that format.");
- } else {
- simple_error_message_box(
- "The file \"%s\" is a capture for a network type that Wireshark doesn't support.\n"
- "(%s)",
- display_basename, err_info);
- g_free(err_info);
- }
+ /* Seen only when opening a capture file for writing. */
+ simple_error_message_box("Wireshark can't save this capture in that format.");
break;
case WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED: