summaryrefslogtreecommitdiff
path: root/nuttx
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-04-14 07:31:35 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-04-14 07:31:35 -0600
commit339457b9a7c6dcebb5a7f5257d3633cd770edebc (patch)
tree37cf6c0d19cff64493245eb2b9b9ee135dbdf337 /nuttx
parente475a7d7043d074880ba2cb83178c6bff346e978 (diff)
downloadpx4-nuttx-339457b9a7c6dcebb5a7f5257d3633cd770edebc.tar.gz
px4-nuttx-339457b9a7c6dcebb5a7f5257d3633cd770edebc.tar.bz2
px4-nuttx-339457b9a7c6dcebb5a7f5257d3633cd770edebc.zip
atexit: Fix reference to undefined variable in certain configurations. From Juha Niskanen
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/sched/task/task_atexit.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/nuttx/sched/task/task_atexit.c b/nuttx/sched/task/task_atexit.c
index cd18e0c59..d8d99eb9e 100644
--- a/nuttx/sched/task/task_atexit.c
+++ b/nuttx/sched/task/task_atexit.c
@@ -91,7 +91,7 @@
*
* NOTE: CONFIG_SCHED_ATEXIT must be defined to enable this function
*
- * Limitiations 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 recieves more parameters than it expects).
+ * can handle a callback function that receives 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 array 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])