aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortest2 <test2@safs64.(none)>2010-03-09 12:27:31 -0800
committertest2 <test2@safs64.(none)>2010-03-09 12:27:31 -0800
commitb3eca60b5c2246ae25c886c5df44b3176fa90239 (patch)
treed8aec8604b506aad45bfaba7946770f91f14a214
parent5377f7340bba1a74928b976c07faf2537ae6cbea (diff)
Added the definition of SET_BINMODE under WIN32.
-rw-r--r--sf-pcap.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sf-pcap.c b/sf-pcap.c
index 6903160..9d55dae 100644
--- a/sf-pcap.c
+++ b/sf-pcap.c
@@ -68,6 +68,19 @@ static const char rcsid[] _U_ =
#include "sf-pcap.h"
/*
+ * Setting O_BINARY on DOS/Windows is a bit tricky
+ */
+#if defined(WIN32)
+ #define SET_BINMODE(f) _setmode(_fileno(f), _O_BINARY)
+#elif defined(MSDOS)
+ #if defined(__HIGHC__)
+ #define SET_BINMODE(f) setmode(f, O_BINARY)
+ #else
+ #define SET_BINMODE(f) setmode(fileno(f), O_BINARY)
+ #endif
+#endif
+
+/*
* Standard libpcap format.
*/
#define TCPDUMP_MAGIC 0xa1b2c3d4