From c21ac0fff997a382929d1a53cf32d841fc35549f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 24 Oct 2006 10:27:38 +0200 Subject: [PATCH] [PATCH] Only unlink the same file once If filename= is used, make sure we only do the unlink() once. Signed-off-by: Jens Axboe --- filesetup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/filesetup.c b/filesetup.c index 4310a79f..52d822ac 100644 --- a/filesetup.c +++ b/filesetup.c @@ -404,8 +404,11 @@ void close_files(struct thread_data *td) for_each_file(td, f, i) { if (f->fd != -1) { - if (td->unlink && td->filetype == FIO_TYPE_FILE) + if (td->unlink && td->filetype == FIO_TYPE_FILE && + td->filename) { unlink(f->file_name); + td->filename = NULL; + } free(f->file_name); f->file_name = NULL; close(f->fd); -- 2.25.1