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
f161a1d0
Commit
f161a1d0
authored
10 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
atexit: Fix reference to undefined variable in certain configurations. From Juha Niskanen
parent
a0866c07
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
sched/task/task_atexit.c
+4
-5
4 additions, 5 deletions
sched/task/task_atexit.c
with
4 additions
and
5 deletions
sched/task/task_atexit.c
+
4
−
5
View file @
f161a1d0
...
...
@@ -91,7 +91,7 @@
*
* NOTE: CONFIG_SCHED_ATEXIT must be defined to enable this function
*
* Limit
i
ations in the current implementation:
* Limitations in the current implementation:
*
* 1. Only a single atexit function can be registered unless
* CONFIG_SCHED_ATEXIT_MAX defines a larger number.
...
...
@@ -100,7 +100,7 @@
* 3. If both SCHED_ONEXIT and SCHED_ATEXIT are selected, then atexit()
* is built on top of the on_exit() implementation. In that case,
* CONFIG_SCHED_ONEXIT_MAX determines the size of the combined
* number of atexit(
0
) and on_exit calls and SCHED_ATEXIT_MAX is
* number of atexit() and on_exit
()
calls and SCHED_ATEXIT_MAX is
* not used.
*
* Input Parameters:
...
...
@@ -115,7 +115,7 @@ int atexit(void (*func)(void))
{
#if defined(CONFIG_SCHED_ONEXIT)
/* atexit is equivalent to on_exit() with no argument (Assuming that the ABI
* can handle a callback function that rec
i
eves more parameters than it expects).
* can handle a callback function that rece
i
ves more parameters than it expects).
*/
return
on_exit
((
onexitfunc_t
)
func
,
NULL
);
...
...
@@ -135,12 +135,11 @@ int atexit(void (*func)(void))
sched_lock
();
/* Search for the first available slot. atexit() functions are registered
* from lower to higher arry indices; they must be called in the reverse
* from lower to higher arr
a
y indices; they must be called in the reverse
* order of registration when task exists, i.e., from higher to lower
* indices.
*/
available
=
-
1
;
for
(
index
=
0
;
index
<
CONFIG_SCHED_ATEXIT_MAX
;
index
++
)
{
if
(
!
group
->
tg_atexitfunc
[
index
])
...
...
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