From: Jens Axboe Date: Mon, 7 Apr 2008 07:00:54 +0000 (+0200) Subject: Need to prefix directory= setting before checking dir part of filename= X-Git-Tag: fio-1.20-rc4~6 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=bc8389191e2fda370890bb34928a8b5b6433f199 Need to prefix directory= setting before checking dir part of filename= Signed-off-by: Jens Axboe --- 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) {