From 9e290c10b5a5f152a4aa6c1bd014a14aa6a0f03c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 14 Nov 2014 09:53:11 -0600 Subject: [PATCH] Fix some compile issues introduces with removal of CONFIG_MAX_TASK_ARGS --- binfmt/binfmt_exec.c | 6 +++--- sched/task/task_vfork.c | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/binfmt/binfmt_exec.c b/binfmt/binfmt_exec.c index 0dbd13b0ec..642eb4541d 100644 --- a/binfmt/binfmt_exec.c +++ b/binfmt/binfmt_exec.c @@ -138,9 +138,9 @@ static inline int binfmt_copyargv(FAR struct binary_s *bin, FAR char * const *ar /* Copy the argv list */ - binp->argv = (FAR char **)bin->argbuffer; - ptr = bin->argbuffer + argvsize; - for (; i < argv[i]; i++) + bin->argv = (FAR char **)bin->argbuffer; + ptr = bin->argbuffer + argvsize; + for (; argv[i]; i++) { bin->argv[i] = ptr; argsize = strlen(argv[i]) + 1; diff --git a/sched/task/task_vfork.c b/sched/task/task_vfork.c index 3b0ffad763..20e74179b1 100644 --- a/sched/task/task_vfork.c +++ b/sched/task/task_vfork.c @@ -116,7 +116,9 @@ static inline void vfork_namesetup(FAR struct tcb_s *parent, static inline int vfork_stackargsetup(FAR struct tcb_s *parent, FAR struct task_tcb_s *child) { - /* Is the parent a task? or a pthread? */ + /* Is the parent a task? or a pthread? Only tasks (and kernel threads) + * have command line arguments. + */ child->argv = NULL; if ((parent->flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_PTHREAD) @@ -159,6 +161,8 @@ static inline int vfork_stackargsetup(FAR struct tcb_s *parent, child->argv[argc] = NULL; } + + return OK; } /****************************************************************************