Properly initialize shadow_fd to -1
authorJens Axboe <axboe@fb.com>
Tue, 1 Apr 2014 18:28:15 +0000 (12:28 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 1 Apr 2014 18:28:15 +0000 (12:28 -0600)
We forget that in one case, causing all sorts of issues when
we end up closing this bogus (STDIN) descriptor.

Signed-off-by: Jens Axboe <axboe@fb.com>
filesetup.c

index db80a8b..fd55cc4 100644 (file)
@@ -1421,6 +1421,7 @@ void dup_files(struct thread_data *td, struct thread_data *org)
                        assert(0);
                }
                __f->fd = -1;
+               __f->shadow_fd = -1;
                fio_file_reset(td, __f);
 
                if (f->file_name) {