X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=memory.c;h=8c06d94d85e7a48ecfb5d8681a8780658f567f6c;hp=b208320c5d88cc619f7167626e3b7502ded07799;hb=5bcc4e471b70d04c9dec36b3cd20eb3a07d92246;hpb=d01612f3ae2515eb035d0c4ce954d8cb167a0a61 diff --git a/memory.c b/memory.c index b208320c..8c06d94d 100644 --- a/memory.c +++ b/memory.c @@ -158,9 +158,10 @@ static int alloc_mem_mmap(struct thread_data *td, size_t total_mem) if (td->orig_buffer == MAP_FAILED) { td_verror(td, errno, "mmap"); td->orig_buffer = NULL; - if (td->mmapfd) { + if (td->mmapfd != 1) { close(td->mmapfd); - unlink(td->o.mmapfile); + if (td->o.mmapfile) + unlink(td->o.mmapfile); } return 1;