summaryrefslogtreecommitdiff
path: root/nuttx/sched/sched_releasefiles.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-09-01 18:06:15 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-09-01 18:06:15 +0000
commit5d303ec17efc511d8cfe0919a790b44e24a8aad9 (patch)
tree76c519b5903e6d1e2880f7fb0d403838f7acddac /nuttx/sched/sched_releasefiles.c
parent0cab5d84f146c0f6105192db5593aa4019edcdcf (diff)
downloadpx4-nuttx-5d303ec17efc511d8cfe0919a790b44e24a8aad9.tar.gz
px4-nuttx-5d303ec17efc511d8cfe0919a790b44e24a8aad9.tar.bz2
px4-nuttx-5d303ec17efc511d8cfe0919a790b44e24a8aad9.zip
Added support for socket descriptors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@318 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/sched_releasefiles.c')
-rw-r--r--nuttx/sched/sched_releasefiles.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/nuttx/sched/sched_releasefiles.c b/nuttx/sched/sched_releasefiles.c
index c511bdb54..707e8636a 100644
--- a/nuttx/sched/sched_releasefiles.c
+++ b/nuttx/sched/sched_releasefiles.c
@@ -38,8 +38,11 @@
************************************************************/
#include <nuttx/config.h>
+#if CONFIG_NFILE_DESCRIPTORS > 0 || CONFIG_NSOCKET_DESCRIPTORS > 0
+
#include <sched.h>
#include <nuttx/fs.h>
+#include <nuttx/net.h>
#include <nuttx/lib.h>
/************************************************************
@@ -66,12 +69,11 @@
*
************************************************************/
-#if CONFIG_NFILE_DESCRIPTORS > 0
-
int sched_releasefiles(_TCB *tcb)
{
if (tcb)
{
+#if CONFIG_NFILE_DESCRIPTORS > 0
/* Free the file descriptor list */
files_releaselist(tcb->filelist);
@@ -83,7 +85,17 @@ int sched_releasefiles(_TCB *tcb)
lib_releaselist(tcb->streams);
tcb->streams = NULL;
#endif /* CONFIG_NFILE_STREAMS */
+#endif /* CONFIG_NFILE_DESCRIPTORS */
+
+#if CONFIG_NSOCKET_DESCRIPTORS > 0
+ /* Free the file descriptor list */
+
+ net_releaselist(tcb->sockets);
+ tcb->sockets = NULL;
+
+#endif /* CONFIG_NSOCKET_DESCRIPTORS */
}
return OK;
}
-#endif /* CONFIG_NFILE_DESCRIPTORS */
+
+#endif /* CONFIG_NFILE_DESCRIPTORS || CONFIG_NSOCKET_DESCRIPTORS */