X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=ad7fb8551da7b87889e3e0ec5d087089e918b5fd;hp=b6cf2e7df1e9e8b47681917a1d43741168d9e2bd;hb=9c0f3f3279985b724c2f1358bb05cc2c795f2265;hpb=77731b29c35286a43ca6109ebf13389169ec20e9;ds=sidebyside diff --git a/filesetup.c b/filesetup.c index b6cf2e7d..ad7fb855 100644 --- a/filesetup.c +++ b/filesetup.c @@ -69,6 +69,10 @@ static int extend_file(struct thread_data *td, struct fio_file *f) if (new_layout) flags |= O_TRUNC; +#ifdef WIN32 + flags |= _O_BINARY; +#endif + dprint(FD_FILE, "open file %s, flags %x\n", f->file_name, flags); f->fd = open(f->file_name, flags, 0644); if (f->fd < 0) { @@ -481,6 +485,10 @@ int file_lookup_open(struct fio_file *f, int flags) from_hash = 0; } +#ifdef WIN32 + flags |= _O_BINARY; +#endif + f->fd = open(f->file_name, flags, 0600); return from_hash; } @@ -1040,7 +1048,7 @@ int init_random_map(struct thread_data *td) unsigned long seed; seed = td->rand_seeds[FIO_RAND_BLOCK_OFF]; - + if (!lfsr_init(&f->lfsr, blocks, seed, 0)) continue; } else if (!td->o.norandommap) {