summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Cran <bruce@cran.org.uk>2012-02-22 17:55:16 +0000
committerJens Axboe <axboe@kernel.dk>2012-02-22 20:32:38 +0100
commit3892182aff21486d9c38a346fe8681c9098ecb0c (patch)
treeb34ddc03495b63666d8e93822ad87b247a2a5071
parenta3e87103daa6b8eb274dce8409ebc87fe3a3595d (diff)
downloadfio-3892182aff21486d9c38a346fe8681c9098ecb0c.tar.gz
fio-3892182aff21486d9c38a346fe8681c9098ecb0c.tar.bz2
stat() doesn't work with devices on Windows, so move check for '\\.\' earlier.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--filesetup.c9
1 files changed, 6 insertions, 3 deletions
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;