mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 03:23:33 +08:00
NSH will now run files from the file system; Add logic to unload and clean-up after running a task from a file system; Extensions to builtin apps from Mike Smith
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5529 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/binfmt/binfmt.h>
|
||||
|
||||
#include "binfmt_internal.h"
|
||||
@@ -97,6 +98,7 @@ int exec(FAR const char *filename, FAR const char **argv,
|
||||
#ifdef CONFIG_SCHED_ONEXIT
|
||||
FAR struct binary_s *bin;
|
||||
int errorcode;
|
||||
int pid;
|
||||
int ret;
|
||||
|
||||
/* Allocate the load information */
|
||||
@@ -131,8 +133,8 @@ int exec(FAR const char *filename, FAR const char **argv,
|
||||
|
||||
/* Then start the module */
|
||||
|
||||
ret = exec_module(bin);
|
||||
if (ret < 0)
|
||||
pid = exec_module(bin);
|
||||
if (pid < 0)
|
||||
{
|
||||
bdbg("ERROR: Failed to execute program '%s'\n", filename);
|
||||
sched_unlock();
|
||||
@@ -145,14 +147,14 @@ int exec(FAR const char *filename, FAR const char **argv,
|
||||
* when the task exists.
|
||||
*/
|
||||
|
||||
ret = schedul_unload(ret, bin);
|
||||
ret = schedule_unload(pid, bin);
|
||||
if (ret < 0)
|
||||
{
|
||||
bdbg("ERROR: Failed to schedul unload '%s'\n", filename);
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
return ret;
|
||||
return pid;
|
||||
#else
|
||||
struct binary_s bin;
|
||||
int ret;
|
||||
|
||||
Reference in New Issue
Block a user