summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh_apps.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-02 16:04:09 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-02-02 16:04:09 +0000
commit426dc74b959df16ea2c63ddefb07aa874a17a367 (patch)
tree1642619d0c60b8a67c98baaca85e372bf524d8e4 /apps/nshlib/nsh_apps.c
parent27d64b50095b5a95d4c41244993ca42d5062c627 (diff)
downloadpx4-nuttx-426dc74b959df16ea2c63ddefb07aa874a17a367.tar.gz
px4-nuttx-426dc74b959df16ea2c63ddefb07aa874a17a367.tar.bz2
px4-nuttx-426dc74b959df16ea2c63ddefb07aa874a17a367.zip
NSH now uses the new Telnet daemon and built-in tasks started by NSH can be used over Telnet
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4361 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/nshlib/nsh_apps.c')
-rw-r--r--apps/nshlib/nsh_apps.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/apps/nshlib/nsh_apps.c b/apps/nshlib/nsh_apps.c
index d70c0d10f..c6f750948 100644
--- a/apps/nshlib/nsh_apps.c
+++ b/apps/nshlib/nsh_apps.c
@@ -1,7 +1,7 @@
/****************************************************************************
* apps/nshlib/nsh_apps.c
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2011 Uros Platise. All rights reserved.
* Author: Uros Platise <uros.platise@isotel.eu>
*
@@ -51,6 +51,7 @@
#include <apps/apps.h>
#include "nsh.h"
+#include "nsh_console.h"
#ifdef CONFIG_NSH_BUILTIN_APPS
@@ -89,30 +90,30 @@
int nsh_execapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
FAR char **argv)
{
- int ret = OK;
+ int ret = OK;
- /* Try to find command within pre-built application list. */
+ /* Try to find command within pre-built application list. */
- ret = exec_namedapp(cmd, (FAR const char **)argv);
- if (ret < 0)
- {
- return -errno;
- }
+ ret = exec_namedapp(cmd, (FAR const char **)argv);
+ if (ret < 0)
+ {
+ return -errno;
+ }
#ifdef CONFIG_SCHED_WAITPID
- if (vtbl->np.np_bg == false)
- {
- waitpid(ret, NULL, 0);
- }
- else
+ if (vtbl->np.np_bg == false)
+ {
+ waitpid(ret, NULL, 0);
+ }
+ else
#endif
- {
- struct sched_param param;
- sched_getparam(0, &param);
- nsh_output(vtbl, "%s [%d:%d]\n", cmd, ret, param.sched_priority);
- }
+ {
+ struct sched_param param;
+ sched_getparam(0, &param);
+ nsh_output(vtbl, "%s [%d:%d]\n", cmd, ret, param.sched_priority);
+ }
- return OK;
+ return OK;
}
#endif /* CONFIG_NSH_BUILTIN_APPS */