X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=filesetup.c;h=446eeaf0801a2772470bb2a47cde0c5368a67d70;hb=b01329d04d9533d399f2477348662dbef20ca8ba;hp=d55af45404af36ab8d1204479d844d5525bc7adb;hpb=ceadd59ef93421001530aa765d928e9e8c26b32e;p=fio.git diff --git a/filesetup.c b/filesetup.c index d55af454..446eeaf0 100644 --- a/filesetup.c +++ b/filesetup.c @@ -926,10 +926,13 @@ static void get_file_type(struct fio_file *f) else f->filetype = FIO_TYPE_FILE; + /* \\.\ is the device namespace in Windows, where every file is + * a block device */ + if (strncmp(f->file_name, "\\\\.\\", 4) == 0) + f->filetype = FIO_TYPE_BD; + if (!stat(f->file_name, &sb)) { - /* \\.\ is the device namespace in Windows, where every file is - * a block device */ - if (S_ISBLK(sb.st_mode) || strncmp(f->file_name, "\\\\.\\", 4) == 0) + if (S_ISBLK(sb.st_mode)) f->filetype = FIO_TYPE_BD; else if (S_ISCHR(sb.st_mode)) f->filetype = FIO_TYPE_CHAR; @@ -1138,7 +1141,7 @@ static int recurse_dir(struct thread_data *td, const char *dirname) if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, "..")) continue; - sprintf(full_path, "%s/%s", dirname, dir->d_name); + sprintf(full_path, "%s%s%s", dirname, FIO_OS_PATH_SEPARATOR, dir->d_name); if (lstat(full_path, &sb) == -1) { if (errno != ENOENT) {