aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-02-11 01:23:25 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2004-02-11 01:23:25 +0000
commitae4b48d9616ce1364dffe2ae2f959ae5f47117e4 (patch)
treea51e826d510cce43db5779afb98d8e2a705da366 /file.c
parent0ae3628a21cf8805f34beaee553853439901c667 (diff)
Add an "open_failure_alert_box()" routine to pop up an alert box for a
failed attempt to open/create a file. Fix one call to pass the right value for the "for_writing" flag. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10026 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'file.c')
-rw-r--r--file.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/file.c b/file.c
index 23c47cb805..d91bdb599a 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.358 2004/02/11 00:55:27 guy Exp $
+ * $Id: file.c,v 1.359 2004/02/11 01:23:24 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -70,6 +70,7 @@
#include "file.h"
#include "menu.h"
#include "util.h"
+#include "alert_box.h"
#include "simple_dialog.h"
#include "progress_dlg.h"
#include "ui_util.h"
@@ -2979,9 +2980,7 @@ copy_binary_file(char *from_filename, char *to_filename)
/* Copy the raw bytes of the file. */
from_fd = open(from_filename, O_RDONLY | O_BINARY);
if (from_fd < 0) {
- err = errno;
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
- file_open_error_message(err, TRUE), from_filename);
+ open_failure_alert_box(from_filename, errno, FALSE);
goto done;
}
@@ -2992,9 +2991,7 @@ copy_binary_file(char *from_filename, char *to_filename)
to be open in binary mode. */
to_fd = open(to_filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
if (to_fd < 0) {
- err = errno;
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
- file_open_error_message(err, TRUE), to_filename);
+ open_failure_alert_box(to_filename, errno, TRUE);
close(from_fd);
goto done;
}