aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/proto_draw.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2004-02-20 17:31:00 +0000
committerUlf Lamping <ulf.lamping@web.de>2004-02-20 17:31:00 +0000
commitb083ba1ed42a8ce52f748996ac1ec72bf0bb62ad (patch)
tree706a826757f059f92c38d0d39f5fc79c8360b717 /gtk/proto_draw.c
parente79d6d725e8e52dbea3aa45f19cfffb4d11416f5 (diff)
bugfix for export selected data: win32 needs O_BINARY flag for open call,
otherwise it will do text mode translations (CRNL things) which isn't desired here svn path=/trunk/; revision=10134
Diffstat (limited to 'gtk/proto_draw.c')
-rw-r--r--gtk/proto_draw.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gtk/proto_draw.c b/gtk/proto_draw.c
index cd05f8788e..e5361121e4 100644
--- a/gtk/proto_draw.c
+++ b/gtk/proto_draw.c
@@ -1,7 +1,7 @@
/* proto_draw.c
* Routines for GTK+ packet display
*
- * $Id: proto_draw.c,v 1.88 2004/02/11 01:37:13 guy Exp $
+ * $Id: proto_draw.c,v 1.89 2004/02/20 17:31:00 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -35,6 +35,10 @@
#include <io.h> /* open/close on win32 */
#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -64,6 +68,12 @@
#include "alert_box.h"
#include "simple_dialog.h"
+
+/* Win32 needs the O_BINARY flag for open() */
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
#define BYTE_VIEW_WIDTH 16
#define BYTE_VIEW_SEP 8
@@ -740,8 +750,6 @@ add_byte_views(epan_dissect_t *edt, GtkWidget *tree_view,
gtk_notebook_set_page(GTK_NOTEBOOK(byte_nb_ptr), 0);
}
-#include <fcntl.h>
-
static GtkWidget *savehex_dlg=NULL;
static GtkWidget *file_entry=NULL;
@@ -916,7 +924,7 @@ savehex_save_clicked_cb(GtkWidget * w _U_, gpointer data _U_)
return;
}
- fd = open(file, O_WRONLY|O_CREAT|O_TRUNC, 0666);
+ fd = open(file, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0666);
if (fd == -1) {
open_failure_alert_box(file, errno, TRUE);
return;