aboutsummaryrefslogtreecommitdiff
path: root/rt
diff options
context:
space:
mode:
Diffstat (limited to 'rt')
-rw-r--r--rt/aio_cancel.c36
-rw-r--r--rt/aio_misc.c12
2 files changed, 26 insertions, 22 deletions
diff --git a/rt/aio_cancel.c b/rt/aio_cancel.c
index 645ae16..8a23353 100644
--- a/rt/aio_cancel.c
+++ b/rt/aio_cancel.c
@@ -106,24 +106,26 @@ aio_cancel (fildes, aiocbp)
/* If any request is worked on by a thread it must be the first.
So either we can delete all requests or all but the first. */
if (req != NULL)
- if (req->running == allocated)
- {
- struct requestlist *old = req;
- req = req->next_prio;
- old->next_prio = NULL;
+ {
+ if (req->running == allocated)
+ {
+ struct requestlist *old = req;
+ req = req->next_prio;
+ old->next_prio = NULL;
- result = AIO_NOTCANCELED;
- }
- else
- {
- /* Remove entry from the file descriptor list. */
- if (req->last_fd != NULL)
- req->last_fd->next_fd = req->next_fd;
- if (req->next_fd != NULL)
- req->next_fd->last_fd = req->last_fd;
-
- result = AIO_CANCELED;
- }
+ result = AIO_NOTCANCELED;
+ }
+ else
+ {
+ /* Remove entry from the file descriptor list. */
+ if (req->last_fd != NULL)
+ req->last_fd->next_fd = req->next_fd;
+ if (req->next_fd != NULL)
+ req->next_fd->last_fd = req->last_fd;
+
+ result = AIO_CANCELED;
+ }
+ }
}
/* Mark requests as canceled and send signal. */
diff --git a/rt/aio_misc.c b/rt/aio_misc.c
index 0148705..1688a15 100644
--- a/rt/aio_misc.c
+++ b/rt/aio_misc.c
@@ -162,11 +162,13 @@ __aio_find_req (aiocb_union *elem)
runp = runp->next_fd;
if (runp != NULL)
- if (runp->aiocbp->aiocb.aio_fildes != fildes)
- runp = NULL;
- else
- while (runp != NULL && runp->aiocbp != elem)
- runp = runp->next_prio;
+ {
+ if (runp->aiocbp->aiocb.aio_fildes != fildes)
+ runp = NULL;
+ else
+ while (runp != NULL && runp->aiocbp != elem)
+ runp = runp->next_prio;
+ }
return runp;
}