vfork no longer depends on CONFIG_MAX_TASK_ARGS

This commit is contained in:
Gregory Nutt
2014-11-12 19:01:29 -06:00
parent 4638a97f97
commit bb9b0f572d
2 changed files with 51 additions and 18 deletions
+12 -5
View File
@@ -115,15 +115,22 @@ void task_start(void)
}
#endif
/* Count how many non-null arguments we are passing */
/* Count how many non-null arguments we are passing. The first non-null
* argument terminates the list .
*/
for (argc = 1; argc <= CONFIG_MAX_TASK_ARGS; argc++)
argc = 1;
while (tcb->argv[argc])
{
/* The first non-null argument terminates the list */
/* Increment the number of args. Here is a sanity check to
* prevent running away with an unterminated argv[] list.
* MAX_START_ARGS should be sufficiently large that this never
* happens in normal usage.
*/
if (!tcb->argv[argc])
if (++argc > MAX_START_ARGS)
{
break;
exit(EXIT_FAILURE);
}
}