From bc8389191e2fda370890bb34928a8b5b6433f199 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 7 Apr 2008 09:00:54 +0200 Subject: [PATCH] Need to prefix directory= setting before checking dir part of filename= Signed-off-by: Jens Axboe --- options.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/options.c b/options.c index ead31ace..20549edf 100644 --- a/options.c +++ b/options.c @@ -274,8 +274,14 @@ static int check_dir(struct thread_data *td, char *fname) { char file[PATH_MAX], *dir; struct stat sb; + int elen = 0; - strcpy(file, fname); + if (td->o.directory) { + strcpy(file, td->o.directory); + elen = strlen(file); + } + + sprintf(file + elen, "/%s", fname); dir = dirname(file); if (lstat(dir, &sb) < 0) { -- 2.25.1