Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
67030f90
Commit
67030f90
authored
10 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
Add test for aio_cancel() and fix some bugs found by the test
parent
002e6869
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fs/aio/aio_cancel.c
+22
-7
22 additions, 7 deletions
fs/aio/aio_cancel.c
with
22 additions
and
7 deletions
fs/aio/aio_cancel.c
+
22
−
7
View file @
67030f90
...
...
@@ -160,11 +160,19 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp)
*/
status
=
work_cancel
(
LPWORK
,
&
aioc
->
aioc_work
);
if
(
status
>=
0
)
{
aiocbp
->
aio_result
=
-
ECANCELED
;
ret
=
AIO_CANCELED
;
}
else
{
ret
=
AIO_NOTCANCELED
;
}
/* Remove the container from the list of pending transfers */
(
void
)
aioc_decant
(
aioc
);
ret
=
status
>=
0
?
AIO_CANCELED
:
AIO_NOTCANCELED
;
}
}
}
...
...
@@ -201,14 +209,21 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp)
/* Remove the container from the list of pending transfers */
next
=
(
FAR
struct
aio_container_s
*
)
aioc
->
aioc_link
.
flink
;
(
void
)
aioc_decant
(
aioc
);
/* Keep track of the return status */
next
=
(
FAR
struct
aio_container_s
*
)
aioc
->
aioc_link
.
flink
;
aiocbp
=
aioc_decant
(
aioc
);
DEBUGASSERT
(
aiocbp
);
if
(
ret
!=
AIO_NOTCANCELED
)
if
(
status
>=
0
)
{
aiocbp
->
aio_result
=
-
ECANCELED
;
if
(
ret
!=
AIO_NOTCANCELED
)
{
ret
=
AIO_CANCELED
;
}
}
else
{
ret
=
status
>=
0
?
AIO_CANCELED
:
AIO_NOTCANCELED
;
ret
=
AIO_NOTCANCELED
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment