summaryrefslogtreecommitdiff
path: root/nuttx/examples/nsh
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-08-30 23:03:06 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-08-30 23:03:06 +0000
commit50041ff73393316f3c4da440844279d49136a9a2 (patch)
tree86bc6f270ad0d0f6313c64137e95091b15e097e9 /nuttx/examples/nsh
parente05a67775f439d921e7c34fbb689f8401d44490a (diff)
downloadpx4-nuttx-50041ff73393316f3c4da440844279d49136a9a2.tar.gz
px4-nuttx-50041ff73393316f3c4da440844279d49136a9a2.tar.bz2
px4-nuttx-50041ff73393316f3c4da440844279d49136a9a2.zip
Fix compilation when pthreads disabled
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@857 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/examples/nsh')
-rw-r--r--nuttx/examples/nsh/nsh_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/nuttx/examples/nsh/nsh_main.c b/nuttx/examples/nsh/nsh_main.c
index 7ca2937bb..f8c9bdb24 100644
--- a/nuttx/examples/nsh/nsh_main.c
+++ b/nuttx/examples/nsh/nsh_main.c
@@ -403,6 +403,7 @@ static pthread_addr_t nsh_child(pthread_addr_t arg)
* Name: nsh_cloneargs
****************************************************************************/
+#ifndef CONFIG_DISABLE_PTHREAD
static inline struct cmdarg_s *nsh_cloneargs(FAR struct nsh_vtbl_s *vtbl,
int fd, int argc, char *argv[])
{
@@ -422,6 +423,7 @@ static inline struct cmdarg_s *nsh_cloneargs(FAR struct nsh_vtbl_s *vtbl,
}
return ret;
}
+#endif
/****************************************************************************
* Name: nsh_argument
@@ -821,7 +823,9 @@ void user_initialize(void)
int user_start(int argc, char *argv[])
{
int mid_priority;
+#if defined(CONFIG_EXAMPLES_NSH_CONSOLE) && defined(CONFIG_EXAMPLES_NSH_TELNET)
int ret;
+#endif
/* Set the priority of this task to something in the middle so that 'nice'
* can both raise and lower the priority.
@@ -882,7 +886,9 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
/* Initialize parser state */
memset(argv, 0, MAX_ARGV_ENTRIES*sizeof(FAR char *));
+#ifndef CONFIG_DISABLE_PTHREAD
vtbl->np.np_bg = FALSE;
+#endif
vtbl->np.np_redirect = FALSE;
/* Parse out the command at the beginning of the line */
@@ -946,12 +952,14 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
/* Check if the command should run in background */
+#ifndef CONFIG_DISABLE_PTHREAD
if (argc > 1 && strcmp(argv[argc-1], "&") == 0)
{
vtbl->np.np_bg = TRUE;
argv[argc-1] = NULL;
argc--;
}
+#endif
/* Check if the output was re-directed using > or >> */
@@ -1136,11 +1144,13 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline)
return nsh_saveresult(vtbl, FALSE);
+#ifndef CONFIG_DISABLE_PTHREAD
errout_with_redirect:
if (vtbl->np.np_redirect)
{
close(fd);
}
+#endif
errout:
return nsh_saveresult(vtbl, TRUE);
}