[PATCH] Network engine poll() paranoia
authorJens Axboe <jens.axboe@oracle.com>
Sun, 11 Feb 2007 03:44:02 +0000 (04:44 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Sun, 11 Feb 2007 03:44:02 +0000 (04:44 +0100)
A little defensive programming never hurt anyone.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/net.c

index c30f7f5..0231451 100644 (file)
@@ -179,6 +179,12 @@ static int fio_netio_accept_connections(struct thread_data *td, int fd,
                } else if (!ret)
                        continue;
 
+               /*
+                * should be impossible
+                */
+               if (!(pfd.revents & POLLIN))
+                       continue;
+
                for_each_file(td, f, i) {
                        if (f->fd != -1)
                                continue;