From fa01d139c558a3788154c5b0f094bfdb5325728f Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 22 Feb 2007 14:07:39 +0100 Subject: [PATCH] Don't check st_size for special files Signed-off-by: Jens Axboe --- filesetup.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/filesetup.c b/filesetup.c index 84cd7f7d..08742247 100644 --- a/filesetup.c +++ b/filesetup.c @@ -18,9 +18,15 @@ static int file_ok(struct thread_data *td, struct fio_file *f) if (td->filetype != FIO_TYPE_FILE || (td->io_ops->flags & FIO_NULLIO)) return 0; - if (stat(f->file_name, &st) == -1) + if (lstat(f->file_name, &st) == -1) return 1; - else if (st.st_size < (off_t) f->file_size) + + /* + * if it's a special file, size is always ok for now + */ + if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) + return 0; + if (st.st_size < (off_t) f->file_size) return 1; return 0; -- 2.25.1