X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=filesetup.c;h=446eeaf0801a2772470bb2a47cde0c5368a67d70;hb=3892182a;hp=cf5ec8e95585ffd004c95d3ff4f2e1188aee2ec6;hpb=a3e87103daa6b8eb274dce8409ebc87fe3a3595d;p=fio.git diff --git a/filesetup.c b/filesetup.c index cf5ec8e9..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;