fix a weird check of the return value of aio_cancel.
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Fri, 11 Jun 2010 07:21:33 +0000 (09:21 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Fri, 11 Jun 2010 07:21:33 +0000 (09:21 +0200)
i don't know what this 1 means in the first place but at least
it isn't portable.  instead, check if the i/o has already
completed. (AIO_ALLDONE)

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
engines/posixaio.c

index 70282f2975f660185fa832dcbf868850e011f0a1..7098d72677428d2dc314eb550f34129566ddc533 100644 (file)
@@ -56,7 +56,7 @@ static int fio_posixaio_cancel(struct thread_data fio_unused *td,
        struct fio_file *f = io_u->file;
        int r = aio_cancel(f->fd, &io_u->aiocb);
 
        struct fio_file *f = io_u->file;
        int r = aio_cancel(f->fd, &io_u->aiocb);
 
-       if (r == 1 || r == AIO_CANCELED)
+       if (r == AIO_ALLDONE || r == AIO_CANCELED)
                return 0;
 
        return 1;
                return 0;
 
        return 1;