diff options
Diffstat (limited to 'nuttx/sched/sched_setuppthreadfiles.c')
-rw-r--r-- | nuttx/sched/sched_setuppthreadfiles.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/nuttx/sched/sched_setuppthreadfiles.c b/nuttx/sched/sched_setuppthreadfiles.c index 75e20ef0a..648d9273e 100644 --- a/nuttx/sched/sched_setuppthreadfiles.c +++ b/nuttx/sched/sched_setuppthreadfiles.c @@ -58,11 +58,11 @@ ****************************************************************************/ /**************************************************************************** - * Function: sched_setuppthreadfiles + * Name: sched_setuppthreadfiles * * Description: - * Configure a newly allocated TCB so that it will inherit - * file descriptors and streams from the parent pthread. + * Configure a newly allocated TCB so that it will inherit file + * descriptors and streams from the parent pthread. * * Parameters: * tcb - tcb of the new task. @@ -85,23 +85,23 @@ int sched_setuppthreadfiles(FAR _TCB *tcb) tcb->filelist = rtcb->filelist; files_addreflist(tcb->filelist); -#if CONFIG_NFILE_STREAMS > 0 - /* The child thread inherits the parent streams */ - - tcb->streams = rtcb->streams; - lib_addreflist(tcb->streams); - -#endif /* CONFIG_NFILE_STREAMS */ #endif /* CONFIG_NFILE_DESCRIPTORS */ #if CONFIG_NSOCKET_DESCRIPTORS > 0 - /* The child thread inherits the parent file descriptors */ + /* The child thread inherits the parent socket descriptors */ tcb->sockets = rtcb->sockets; net_addreflist(tcb->sockets); #endif /* CONFIG_NSOCKET_DESCRIPTORS */ +#if CONFIG_NFILE_STREAMS > 0 + /* The child thread inherits the parent streams */ + + tcb->streams = rtcb->streams; + lib_addreflist(tcb->streams); + +#endif /* CONFIG_NFILE_STREAMS */ return OK; } |