nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gn...@apache.org
Subject [incubator-nuttx-apps] 02/02: nsh/parse: Try FILE_APPS first in the case of builtin
Date Mon, 18 May 2020 12:54:06 GMT
This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 8997213c2aca8fae0f5537833014f9e016b51dd2
Author: chao.an <anchao@xiaomi.com>
AuthorDate: Mon May 18 14:50:24 2020 +0800

    nsh/parse: Try FILE_APPS first in the case of builtin
    
    Signed-off-by: chao.an <anchao@xiaomi.com>
---
 builtin/exec_builtin.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/builtin/exec_builtin.c b/builtin/exec_builtin.c
index a1556a1..7f7b34c 100644
--- a/builtin/exec_builtin.c
+++ b/builtin/exec_builtin.c
@@ -182,17 +182,12 @@ int exec_builtin(FAR const char *appname, FAR char * const *argv,
     }
 
 #ifdef CONFIG_LIBC_EXECFUNCS
-  /* A NULL entry point implies that the task is a loadable application */
+  /* Load and execute the application. */
 
-  if (builtin->main == NULL)
-    {
-      /* Load and execute the application. */
+  ret = posix_spawn(&pid, builtin->name, &file_actions, &attr,
+                    (argv) ? &argv[1] : (FAR char * const *)NULL, NULL);
 
-      ret = posix_spawn(&pid, builtin->name, &file_actions,
-                        &attr, (argv) ? &argv[1] : (FAR char * const *)NULL,
-                        NULL);
-    }
-  else
+  if (ret != 0 && builtin->main != NULL)
 #endif
     {
       /* Start the built-in */


Mime
View raw message