}
static int fio_binject_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec fio_unused *t)
+ unsigned int max,
+ const struct timespec fio_unused *t)
{
struct binject_data *bd = td->io_ops->data;
int left = max, ret, r = 0, ev_index = 0;
* don't block for min events == 0
*/
if (!min)
- fio_set_fd_nonblocking(bf->fd, "binject");
+ bd->fd_flags[i] = fio_set_fd_nonblocking(bf->fd, "binject");
+ else
+ bd->fd_flags[i] = -1;
bd->pfds[i].fd = bf->fd;
bd->pfds[i].events = POLLIN;
for_each_file(td, f, i) {
bf = (struct binject_file *) (uintptr_t) f->engine_data;
+ if (bd->fd_flags[i] == -1)
+ continue;
+
if (fcntl(bf->fd, F_SETFL, bd->fd_flags[i]) < 0)
log_err("fio: binject failed to restore fcntl flags: %s\n", strerror(errno));
}