From 2faf9ec84cc329304bd0dcbf928184e11e550108 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 11 Jun 2010 09:21:33 +0200 Subject: [PATCH] fix a weird check of the return value of aio_cancel. 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 Signed-off-by: Jens Axboe --- engines/posixaio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/posixaio.c b/engines/posixaio.c index 70282f29..7098d726 100644 --- a/engines/posixaio.c +++ b/engines/posixaio.c @@ -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); - if (r == 1 || r == AIO_CANCELED) + if (r == AIO_ALLDONE || r == AIO_CANCELED) return 0; return 1; -- 2.25.1