diff --git a/sched/task/task_atexit.c b/sched/task/task_atexit.c index da29b646f5..8031c6858d 100644 --- a/sched/task/task_atexit.c +++ b/sched/task/task_atexit.c @@ -52,6 +52,17 @@ #ifdef CONFIG_SCHED_ATEXIT +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef CONFIG_SCHED_ONEXIT +static void exitfunc(int exitcode, FAR void *arg) +{ + (*(atexitfunc_t)arg)(); +} +#endif + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -95,7 +106,7 @@ int atexit(void (*func)(void)) * it expects). */ - return on_exit((onexitfunc_t)func, NULL); + return on_exit(exitfunc, func); #else FAR struct tcb_s *tcb = this_task();