X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=filesetup.c;h=b45a58265a140700bfb96b4e6dd0930e4ed1a6c2;hb=d3851529fc160bdf8cfa266d2e4b4f87bb76cef9;hp=7fe2ebd42406e9d93cbee838c983f4fc3ab815d1;hpb=b4d867339d3e89ca54104df104f830aa374e31c0;p=fio.git diff --git a/filesetup.c b/filesetup.c index 7fe2ebd4..b45a5826 100644 --- a/filesetup.c +++ b/filesetup.c @@ -918,26 +918,18 @@ static bool create_work_dirs(struct thread_data *td, const char *fname) char path[PATH_MAX]; char *start, *end; - if (td->o.directory) { - snprintf(path, PATH_MAX, "%s%c%s", td->o.directory, - FIO_OS_PATH_SEPARATOR, fname); - start = strstr(path, fname); - } else { - snprintf(path, PATH_MAX, "%s", fname); - start = path; - } + snprintf(path, PATH_MAX, "%s", fname); + start = path; end = start; while ((end = strchr(end, FIO_OS_PATH_SEPARATOR)) != NULL) { - if (end == start) - break; + if (end == start) { + end++; + continue; + } *end = '\0'; errno = 0; -#ifdef CONFIG_HAVE_MKDIR_TWO - if (mkdir(path, 0600) && errno != EEXIST) { -#else - if (mkdir(path) && errno != EEXIST) { -#endif + if (fio_mkdir(path, 0700) && errno != EEXIST) { log_err("fio: failed to create dir (%s): %d\n", start, errno); return false; @@ -1287,7 +1279,9 @@ static bool init_rand_distribution(struct thread_data *td) unsigned int i; int state; - if (td->o.random_distribution == FIO_RAND_DIST_RANDOM) + if (td->o.random_distribution == FIO_RAND_DIST_RANDOM || + td->o.random_distribution == FIO_RAND_DIST_ZONED || + td->o.random_distribution == FIO_RAND_DIST_ZONED_ABS) return false; state = td_bump_runstate(td, TD_SETTING_UP);