On at least some platforms, a #define of O_BINARY is needed even if

<fcntl.h> is included, as <fcntl.h> doesn't define it.

svn path=/trunk/; revision=11276
This commit is contained in:
Guy Harris 2004-06-30 06:58:59 +00:00
parent 24527148ab
commit 272a2055ab
7 changed files with 40 additions and 7 deletions

View File

@ -1,7 +1,7 @@
/* capture.c /* capture.c
* Routines for packet capture windows * Routines for packet capture windows
* *
* $Id: capture.c,v 1.253 2004/06/29 20:51:26 ulfl Exp $ * $Id: capture.c,v 1.254 2004/06/30 06:58:56 guy Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -219,6 +219,10 @@ typedef struct _loop_data {
#endif #endif
} loop_data; } loop_data;
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
static gboolean sync_pipe_do_capture(gboolean is_tempfile); static gboolean sync_pipe_do_capture(gboolean is_tempfile);
static gboolean sync_pipe_input_cb(gint source, gpointer user_data); static gboolean sync_pipe_input_cb(gint source, gpointer user_data);

7
file.c
View File

@ -1,7 +1,7 @@
/* file.c /* file.c
* File I/O routines * File I/O routines
* *
* $Id: file.c,v 1.385 2004/06/29 20:51:26 ulfl Exp $ * $Id: file.c,v 1.386 2004/06/30 06:58:56 guy Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -88,6 +88,11 @@
#include "tap_dfilter_dlg.h" #include "tap_dfilter_dlg.h"
#include "packet-data.h" #include "packet-data.h"
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
#ifdef HAVE_LIBPCAP #ifdef HAVE_LIBPCAP
gboolean auto_scroll_live; gboolean auto_scroll_live;
#endif #endif

View File

@ -1,7 +1,7 @@
/* proto_draw.c /* proto_draw.c
* Routines for GTK+ packet display * Routines for GTK+ packet display
* *
* $Id: proto_draw.c,v 1.106 2004/06/29 20:46:28 ulfl Exp $ * $Id: proto_draw.c,v 1.107 2004/06/30 06:58:58 guy Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -71,6 +71,11 @@
#include "font_utils.h" #include "font_utils.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_WIDTH 16
#define BYTE_VIEW_SEP 8 #define BYTE_VIEW_SEP 8

View File

@ -1,7 +1,7 @@
/* rtp_analysis.c /* rtp_analysis.c
* RTP analysis addition for ethereal * RTP analysis addition for ethereal
* *
* $Id: rtp_analysis.c,v 1.46 2004/06/29 20:46:28 ulfl Exp $ * $Id: rtp_analysis.c,v 1.47 2004/06/30 06:58:58 guy Exp $
* *
* Copyright 2003, Alcatel Business Systems * Copyright 2003, Alcatel Business Systems
* By Lars Ruoff <lars.ruoff@gmx.net> * By Lars Ruoff <lars.ruoff@gmx.net>
@ -83,6 +83,11 @@
#include <io.h> /* open/close on win32 */ #include <io.h> /* open/close on win32 */
#endif #endif
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
/****************************************************************************/ /****************************************************************************/
typedef struct column_arrows { typedef struct column_arrows {

View File

@ -1,6 +1,6 @@
/* Combine two dump files, either by appending or by merging by timestamp /* Combine two dump files, either by appending or by merging by timestamp
* *
* $Id: mergecap.c,v 1.22 2004/06/29 20:59:23 ulfl Exp $ * $Id: mergecap.c,v 1.23 2004/06/30 06:58:57 guy Exp $
* *
* Written by Scott Renfro <scott@renfro.org> based on * Written by Scott Renfro <scott@renfro.org> based on
* editcap by Richard Sharpe and Guy Harris * editcap by Richard Sharpe and Guy Harris
@ -41,6 +41,10 @@
#include <fcntl.h> #include <fcntl.h>
#endif #endif
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
/* /*
* Show the usage * Show the usage

View File

@ -1,7 +1,7 @@
/* ringbuffer.c /* ringbuffer.c
* Routines for packet capture windows * Routines for packet capture windows
* *
* $Id: ringbuffer.c,v 1.11 2004/06/29 20:51:26 ulfl Exp $ * $Id: ringbuffer.c,v 1.12 2004/06/30 06:58:57 guy Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com> * By Gerald Combs <gerald@ethereal.com>
@ -76,6 +76,11 @@
#include "wiretap/wtap.h" #include "wiretap/wtap.h"
#include "ringbuffer.h" #include "ringbuffer.h"
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
/* Ringbuffer file structure */ /* Ringbuffer file structure */
typedef struct _rb_file { typedef struct _rb_file {
gchar *name; gchar *name;

View File

@ -1,6 +1,6 @@
/* file_access.c /* file_access.c
* *
* $Id: file_access.c,v 1.13 2004/06/29 20:46:29 ulfl Exp $ * $Id: file_access.c,v 1.14 2004/06/30 06:58:59 guy Exp $
* *
* Wiretap Library * Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
@ -207,6 +207,11 @@ wtap* wtap_open_offline(const char *filename, int *err, char **err_info,
return NULL; return NULL;
} }
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
/* Open the file */ /* Open the file */
errno = WTAP_ERR_CANT_OPEN; errno = WTAP_ERR_CANT_OPEN;
wth->fd = open(filename, O_RDONLY|O_BINARY); wth->fd = open(filename, O_RDONLY|O_BINARY);