summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh_parse.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-28 18:38:13 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-07-28 18:38:13 +0000
commitf29332dabb08e793f12bfaaf49d851052f3d8bb0 (patch)
treebdfda0ecbd7119b9c3c607e95c9990b75fadf81b /apps/nshlib/nsh_parse.c
parent51f1a88cb89e90f522a94c1dfe5ae16f17465121 (diff)
downloadpx4-nuttx-f29332dabb08e793f12bfaaf49d851052f3d8bb0.tar.gz
px4-nuttx-f29332dabb08e793f12bfaaf49d851052f3d8bb0.tar.bz2
px4-nuttx-f29332dabb08e793f12bfaaf49d851052f3d8bb0.zip
Lock the scheduler when starting NSH builtin applications to eliminate race conditions
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4988 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/nshlib/nsh_parse.c')
-rw-r--r--apps/nshlib/nsh_parse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c
index 64850eb62..93171abf7 100644
--- a/apps/nshlib/nsh_parse.c
+++ b/apps/nshlib/nsh_parse.c
@@ -492,6 +492,8 @@ static int cmd_exit(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
* Exectue the command in argv[0]
*
* Returned Value:
+ * <0 If exec_namedapp() fails, then the negated errno value
+ * is returned.
* -1 (ERRROR) if the command was unsuccessful
* 0 (OK) if the command was successful
* 1 if an application task was spawned successfully, but
@@ -521,8 +523,8 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, int argc, char *argv[])
#ifdef CONFIG_NSH_BUILTIN_APPS
ret = nsh_execapp(vtbl, cmd, argv);
- /* The pre-built application was successfully started -- return OK
- * or 1 if it returned a non-zero exit status.
+ /* If the built-in application was successfully started, return OK
+ * or 1 (if the application returned a non-zero exit status).
*/
if (ret >= 0)