Add logic to automatically unload module on exit; Several patches from Mike Smith

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5528 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-01-17 14:43:55 +00:00
parent 828c1c65c7
commit 956bded9c1
12 changed files with 194 additions and 65 deletions
+5 -3
View File
@@ -89,6 +89,7 @@ static struct binfmt_s g_builtin_binfmt =
static int builtin_loadbinary(struct binary_s *binp)
{
FAR const char *filename;
FAR const struct builtin_s *b;
int fd;
int index;
int ret;
@@ -134,9 +135,10 @@ static int builtin_loadbinary(struct binary_s *binp)
* the priority. That is a bug and needs to be fixed.
*/
binp->entrypt = g_builtins[index].main;
binp->stacksize = g_builtins[index].stacksize;
binp->priority = g_builtins[index].priority;
b = builtin_for_index(index);
binp->entrypt = b->main;
binp->stacksize = b->stacksize;
binp->priority = b->priority;
return OK;
}