From e4e33258637e55550a0fac59eb3350e8bf06f8e6 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 21 Mar 2007 13:07:54 +0100 Subject: [PATCH] Dump actual filename in failure to open Helpful for debugging. Signed-off-by: Jens Axboe --- filesetup.c | 5 ++++- fio.h | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/filesetup.c b/filesetup.c index 289db878..daae33ff 100644 --- a/filesetup.c +++ b/filesetup.c @@ -384,9 +384,12 @@ int generic_open_file(struct thread_data *td, struct fio_file *f) } if (f->fd == -1) { + char buf[FIO_VERROR_SIZE]; int __e = errno; - td_verror(td, __e, "open"); + snprintf(buf, sizeof(buf) - 1, "open(%s)", f->file_name); + + td_verror(td, __e, buf); if (__e == EINVAL && td->o.odirect) log_err("fio: destination does not support O_DIRECT\n"); if (__e == EMFILE) diff --git a/fio.h b/fio.h index 2b4b3c65..ab8f1d9a 100644 --- a/fio.h +++ b/fio.h @@ -411,12 +411,14 @@ struct thread_options { unsigned int cpucycle; }; +#define FIO_VERROR_SIZE 128 + /* * This describes a single thread/process executing a fio job. */ struct thread_data { struct thread_options o; - char verror[128]; + char verror[FIO_VERROR_SIZE]; pthread_t thread; int thread_number; int groupid; -- 2.25.1