Need to prefix directory= setting before checking dir part of filename=
authorJens Axboe <jens.axboe@oracle.com>
Mon, 7 Apr 2008 07:00:54 +0000 (09:00 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 7 Apr 2008 07:00:54 +0000 (09:00 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
options.c

index ead31ace29c00fb88247ea82ec76502edafb582a..20549edfe5ebbadfdc64efabf9700c0bffc74d3e 100644 (file)
--- 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) {