solarisaio: aiowait() can return (void *) -1 for error
authorJens Axboe <jens.axboe@oracle.com>
Mon, 2 Jun 2008 12:18:23 +0000 (14:18 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 2 Jun 2008 12:18:23 +0000 (14:18 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/solarisaio.c

index 0852cde4635fdf6b3e7e8b82bc0190d52ee28a2c..f7f832b8b9ae66842011274f6053ac82ab0f9dde 100644 (file)
@@ -53,7 +53,14 @@ static int fio_solarisaio_getevents(struct thread_data *td, unsigned int min,
                }
 
                p = aiowait(&tv);
-               if (p) {
+               if (p == (aio_result_t *) -1) {
+                       int err = errno;
+
+                       if (err == EINVAL)
+                               break;
+                       td_verror(td, err, "aiowait");
+                       break;
+               } else if (p != NULL) {
                        io_u = container_of(p, struct io_u, resultp);
 
                        sd->aio_events[r++] = io_u;