Skip to content
Snippets Groups Projects
Commit 462becfb authored by patacongo's avatar patacongo
Browse files

Fix compilation when pthreads disabled

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@857 42af7a65-404d-4744-a932-0658087f49c3
parent 84a75fde
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment