Add check for pipe/fifo files
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/filesetup.c b/filesetup.c
index bd975d8..bb25cd5 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -181,7 +181,7 @@
log_err("fio: only root may flush block devices. Cache flush bypassed!\n");
ret = 0;
}
- } else if (f->filetype == FIO_TYPE_CHAR)
+ } else if (f->filetype == FIO_TYPE_CHAR || f->filetype == FIO_TYPE_PIPE)
ret = 0;
if (ret < 0) {
@@ -485,6 +485,8 @@
f->filetype = FIO_TYPE_BD;
else if (S_ISCHR(sb.st_mode))
f->filetype = FIO_TYPE_CHAR;
+ else if (S_ISFIFO(sb.st_mode))
+ f->filetype = FIO_TYPE_PIPE;
}
}
diff --git a/fio.h b/fio.h
index 1a31892..7ac5734 100644
--- a/fio.h
+++ b/fio.h
@@ -224,6 +224,7 @@
FIO_TYPE_FILE = 1, /* plain file */
FIO_TYPE_BD, /* block device */
FIO_TYPE_CHAR, /* character device */
+ FIO_TYPE_PIPE, /* pipe */
};
enum fio_ioengine_flags {