summaryrefslogtreecommitdiff
path: root/nuttx/sched/sched_setupidlefiles.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-14 19:30:31 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-14 19:30:31 +0000
commite135573acc348649e767ca67a1ec189fe4e0fcda (patch)
treeb34f7d2914cba8aeb9311c5bae3771af40054640 /nuttx/sched/sched_setupidlefiles.c
parentd76fa866ad009d65396acf1aa08fcffd3b4b041e (diff)
downloadpx4-nuttx-e135573acc348649e767ca67a1ec189fe4e0fcda.tar.gz
px4-nuttx-e135573acc348649e767ca67a1ec189fe4e0fcda.tar.bz2
px4-nuttx-e135573acc348649e767ca67a1ec189fe4e0fcda.zip
Fix STM32 F2/F4 SDIO clocking; Clean-up files in sched/ directory
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4940 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/sched_setupidlefiles.c')
-rw-r--r--nuttx/sched/sched_setupidlefiles.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/nuttx/sched/sched_setupidlefiles.c b/nuttx/sched/sched_setupidlefiles.c
index f2bfb78d2..ae814e1a6 100644
--- a/nuttx/sched/sched_setupidlefiles.c
+++ b/nuttx/sched/sched_setupidlefiles.c
@@ -62,7 +62,7 @@
****************************************************************************/
/****************************************************************************
- * Function: sched_setupidlefiles
+ * Name: sched_setupidlefiles
*
* Description:
* Configure the idle thread's TCB.
@@ -83,32 +83,32 @@ int sched_setupidlefiles(FAR _TCB *tcb)
int fd;
#endif
-#if CONFIG_NFILE_DESCRIPTORS > 0
/* Allocate file descriptors for the TCB */
+#if CONFIG_NFILE_DESCRIPTORS > 0
tcb->filelist = files_alloclist();
if (!tcb->filelist)
{
return -ENOMEM;
}
-#endif /* CONFIG_NFILE_DESCRIPTORS */
+#endif
-#if CONFIG_NSOCKET_DESCRIPTORS > 0
/* Allocate socket descriptors for the TCB */
+#if CONFIG_NSOCKET_DESCRIPTORS > 0
tcb->sockets = net_alloclist();
if (!tcb->sockets)
{
return -ENOMEM;
}
-#endif /* CONFIG_NSOCKET_DESCRIPTORS */
+#endif
-#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_DEV_CONSOLE)
/* Open stdin, dup to get stdout and stderr. This should always
* be the first file opened and, hence, should always get file
* descriptor 0.
*/
+#if CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_DEV_CONSOLE)
fd = open("/dev/console", O_RDWR);
if (fd == 0)
{
@@ -134,17 +134,15 @@ int sched_setupidlefiles(FAR _TCB *tcb)
}
return -ENFILE;
}
+#endif
-#if CONFIG_NFILE_STREAMS > 0
- /* Allocate file strems for the TCB */
+ /* Allocate file/socket streams for the TCB */
+#if CONFIG_NFILE_STREAMS > 0
return sched_setupstreams(tcb);
#else
return OK;
-#endif /* CONFIG_NFILE_STREAMS */
-#else
- return OK;
-#endif /* CONFIG_NFILE_DESCRIPTORS && CONFIG_DEV_CONSOLE */
+#endif
}
#endif /* CONFIG_NFILE_DESCRIPTORS || CONFIG_NSOCKET_DESCRIPTORS */