diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-02-20 17:31:00 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-02-20 17:31:00 +0000 |
commit | 35c8ca9f8884ec9a1b89a821015422902a38b033 (patch) | |
tree | 706a826757f059f92c38d0d39f5fc79c8360b717 /gtk/proto_draw.c | |
parent | c8d881ff66ac9175f15bc3e727f2cce213404366 (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
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10134 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/proto_draw.c')
-rw-r--r-- | gtk/proto_draw.c | 16 |
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; |