Squashed commit of the following:

apps/builtin/exec_builtin.c:  Try posix_spawn if builtin apps do not have have an entry point.
    apps/Application.mk: introduce MODULE config to simplify tristate(m)
    apps/nsh:  Change the nuttx shell module type to tristate
    apps:  Add loadable application support
    script/mksymtab:  Generate symbol table name by default
    apps/builtin:  Allow loadable applications can register with apps/builtin.
This commit is contained in:
anchao 2018-08-22 09:30:38 -06:00 committed by Gregory Nutt
parent 9fe6d2e1c3
commit 25b92edd9f
326 changed files with 561 additions and 569 deletions

View file

@ -183,9 +183,19 @@ int exec_builtin(FAR const char *appname, FAR char * const *argv,
/* Start the built-in */
ret = task_spawn(&pid, builtin->name, builtin->main, &file_actions,
&attr, (argv) ? &argv[1] : (FAR char * const *)NULL,
(FAR char * const *)NULL);
if (builtin->main)
{
ret = task_spawn(&pid, builtin->name, builtin->main, &file_actions,
&attr, (argv) ? &argv[1] : (FAR char * const *)NULL,
(FAR char * const *)NULL);
}
else
{
ret = posix_spawn(&pid, builtin->name, &file_actions,
&attr, (argv) ? &argv[1] : (FAR char * const *)NULL,
NULL);
}
if (ret != 0)
{
serr("ERROR: task_spawn failed: %d\n", ret);