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
* 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
* By Gerald Combs <gerald@ethereal.com>
@ -219,6 +219,10 @@ typedef struct _loop_data {
#endif
} 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_input_cb(gint source, gpointer user_data);

7
file.c
View File

@ -1,7 +1,7 @@
/* file.c
* 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
* By Gerald Combs <gerald@ethereal.com>
@ -88,6 +88,11 @@
#include "tap_dfilter_dlg.h"
#include "packet-data.h"
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
#ifdef HAVE_LIBPCAP
gboolean auto_scroll_live;
#endif

View File

@ -1,7 +1,7 @@
/* proto_draw.c
* 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
* By Gerald Combs <gerald@ethereal.com>
@ -71,6 +71,11 @@
#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_SEP 8

View File

@ -1,7 +1,7 @@
/* rtp_analysis.c
* 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
* By Lars Ruoff <lars.ruoff@gmx.net>
@ -83,6 +83,11 @@
#include <io.h> /* open/close on win32 */
#endif
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
/****************************************************************************/
typedef struct column_arrows {

View File

@ -1,6 +1,6 @@
/* 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
* editcap by Richard Sharpe and Guy Harris
@ -41,6 +41,10 @@
#include <fcntl.h>
#endif
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
/*
* Show the usage

View File

@ -1,7 +1,7 @@
/* ringbuffer.c
* 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
* By Gerald Combs <gerald@ethereal.com>
@ -76,6 +76,11 @@
#include "wiretap/wtap.h"
#include "ringbuffer.h"
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
/* Ringbuffer file structure */
typedef struct _rb_file {
gchar *name;

View File

@ -1,6 +1,6 @@
/* 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
* 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;
}
/* Win32 needs the O_BINARY flag for open() */
#ifndef O_BINARY
#define O_BINARY 0
#endif
/* Open the file */
errno = WTAP_ERR_CANT_OPEN;
wth->fd = open(filename, O_RDONLY|O_BINARY);