Error check fcntl() calls
[fio.git] / engines / binject.c
index fb1906206a039be8e13f5cc00118307b6febd1dd..0264d0a32c0d62e0f3d5bb3c534ee942c0057f6b 100644 (file)
@@ -109,10 +109,9 @@ static int fio_binject_getevents(struct thread_data *td, unsigned int min,
                /*
                 * don't block for min events == 0
                 */
-               if (!min) {
-                       bd->fd_flags[i] = fcntl(bf->fd, F_GETFL);
-                       fcntl(bf->fd, F_SETFL, bd->fd_flags[i] | O_NONBLOCK);
-               }
+               if (!min)
+                       fio_set_fd_nonblocking(bf->fd, "binject");
+
                bd->pfds[i].fd = bf->fd;
                bd->pfds[i].events = POLLIN;
        }