From c3ac61e1e4751a4bac63dbc816c482dff8bbc194 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Wed, 29 Dec 2004 23:34:08 +0000 Subject: [PATCH] (main,allocate_memory) [_WIN32]: switch the default file mode to binary to match POSIX. Remove the now unneccessary ifdef for the open. --- src/util/fairland.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/util/fairland.c b/src/util/fairland.c index 4c5e3028..c7a29d8c 100644 --- a/src/util/fairland.c +++ b/src/util/fairland.c @@ -194,6 +194,10 @@ main(int argc, char *argv[]) char tbuf[512]; int i = 0; +#if defined(_WIN32) + _fmode = _O_BINARY; +#endif + rnd_seed = time(NULL); while ((opt = getopt(argc, argv, "ae:ioqs:R:")) != EOF) { @@ -407,14 +411,8 @@ allocate_memory(void) { int i; -#if !defined(_WIN32) - the_file = - open(empfile[EF_SECTOR].file, O_RDWR | O_CREAT | O_TRUNC, 0660); -#else - the_file = - open(empfile[EF_SECTOR].file, - O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0660); -#endif + the_file = open(empfile[EF_SECTOR].file, O_RDWR | O_CREAT | O_TRUNC, + 0660); if (the_file < 0) { perror(empfile[EF_SECTOR].file); return -1;