From 9e9d284d9157a8b79964015be868f4e8c43274c3 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 20 Apr 2017 11:23:51 -0700 Subject: Have separate routines for open-for-reading and open-for-writing errors. Expand comments while we're at it. Change-Id: I6dcc791eab1c9e323a9572f3d54720d223bdd64b Reviewed-on: https://code.wireshark.org/review/21252 Reviewed-by: Guy Harris --- editcap.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'editcap.c') diff --git a/editcap.c b/editcap.c index 6f3e804a36..f0564b5267 100644 --- a/editcap.c +++ b/editcap.c @@ -1351,8 +1351,8 @@ main(int argc, char *argv[]) wth = wtap_open_offline(argv[optind], WTAP_TYPE_AUTO, &read_err, &read_err_info, FALSE); if (!wth) { - cfile_open_failure_message("editap", argv[optind], read_err, - read_err_info, FALSE, WTAP_TYPE_AUTO); + cfile_open_failure_message("editcap", argv[optind], read_err, + read_err_info); ret = INVALID_FILE; goto clean_exit; } @@ -1423,9 +1423,8 @@ main(int argc, char *argv[]) shb_hdrs, idb_inf, nrb_hdrs, &write_err); if (pdh == NULL) { - cfile_open_failure_message("editcap", filename, - write_err, NULL, TRUE, - out_frame_type); + cfile_dump_open_failure_message("editcap", filename, + write_err, out_frame_type); ret = INVALID_FILE; goto clean_exit; } @@ -1465,9 +1464,9 @@ main(int argc, char *argv[]) shb_hdrs, idb_inf, nrb_hdrs, &write_err); if (pdh == NULL) { - cfile_open_failure_message("editcap", filename, - write_err, NULL, TRUE, - out_frame_type); + cfile_dump_open_failure_message("editcap", filename, + write_err, + out_frame_type); ret = INVALID_FILE; goto clean_exit; } @@ -1495,9 +1494,9 @@ main(int argc, char *argv[]) snaplen ? MIN(snaplen, wtap_snapshot_length(wth)) : wtap_snapshot_length(wth), shb_hdrs, idb_inf, nrb_hdrs, &write_err); if (pdh == NULL) { - cfile_open_failure_message("editcap", filename, - write_err, NULL, TRUE, - out_frame_type); + cfile_dump_open_failure_message("editcap", filename, + write_err, + out_frame_type); ret = INVALID_FILE; goto clean_exit; } @@ -1809,9 +1808,9 @@ main(int argc, char *argv[]) snaplen ? MIN(snaplen, wtap_snapshot_length(wth)): wtap_snapshot_length(wth), shb_hdrs, idb_inf, nrb_hdrs, &write_err); if (pdh == NULL) { - cfile_open_failure_message("editcap", filename, - write_err, NULL, TRUE, - out_frame_type); + cfile_dump_open_failure_message("editcap", filename, + write_err, + out_frame_type); ret = INVALID_FILE; goto clean_exit; } -- cgit v1.2.1