You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/05/18 12:54:04 UTC

[incubator-nuttx-apps] branch master updated (e2414cd -> 8997213)

This is an automated email from the ASF dual-hosted git repository.

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


    from e2414cd  wireless: gs2200m: Fix to receive a big packet
     new 898c1ce  Revert "This critical behavior was broken by this commit:"
     new 8997213  nsh/parse: Try FILE_APPS first in the case of builtin

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 builtin/exec_builtin.c | 13 ++++---------
 nshlib/nsh_parse.c     | 38 +++++++++++++++++++-------------------
 2 files changed, 23 insertions(+), 28 deletions(-)


[incubator-nuttx-apps] 01/02: Revert "This critical behavior was broken by this commit:"

Posted by gn...@apache.org.
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 898c1ce4d225b696af3dfb5cf3d9b13489b4eae1
Author: chao.an <an...@xiaomi.com>
AuthorDate: Mon May 18 14:46:22 2020 +0800

    Revert "This critical behavior was broken by this commit:"
    
    This reverts commit 9b06b508f957ba1cc5b970d291bb5cc3277db237.
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 nshlib/nsh_parse.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c
index d5a6896..9b0bb2f 100644
--- a/nshlib/nsh_parse.c
+++ b/nshlib/nsh_parse.c
@@ -507,8 +507,8 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl,
    * 4. If not, report that the command was not found.
    */
 
-  /* Does this command correspond to an application filename?
-   * nsh_fileapp() returns:
+  /* Does this command correspond to a built-in command?
+   * nsh_builtin() returns:
    *
    *   -1 (ERROR)  if the application task corresponding to 'argv[0]' could
    *               not be started (possibly because it does not exist).
@@ -523,11 +523,15 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl,
    * Note the priority is not effected by nice-ness.
    */
 
-#ifdef CONFIG_NSH_FILE_APPS
-  ret = nsh_fileapp(vtbl, argv[0], argv, redirfile, oflags);
+#ifdef CONFIG_NSH_BUILTIN_APPS
+#if CONFIG_NFILE_STREAMS > 0
+  ret = nsh_builtin(vtbl, argv[0], argv, redirfile, oflags);
+#else
+  ret = nsh_builtin(vtbl, argv[0], argv, NULL, 0);
+#endif
   if (ret >= 0)
     {
-      /* nsh_fileapp() returned 0 or 1.  This means that the built-in
+      /* nsh_builtin() returned 0 or 1.  This means that the built-in
        * command was successfully started (although it may not have ran
        * successfully).  So certainly it is not an NSH command.
        */
@@ -537,15 +541,15 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl,
       return nsh_saveresult(vtbl, ret != OK);
     }
 
-  /* No, not a file name command (or, at least, we were unable to start a
-   * program of that name).  Maybe it is a built-in application or an NSH
-   * command.
+  /* No, not a built in command (or, at least, we were unable to start a
+   * built-in command of that name). Maybe it is a built-in application
+   * or an NSH command.
    */
 
 #endif
 
-  /* Does this command correspond to a built-in command?
-   * nsh_builtin() returns:
+  /* Does this command correspond to an application filename?
+   * nsh_fileapp() returns:
    *
    *   -1 (ERROR)  if the application task corresponding to 'argv[0]' could
    *               not be started (possibly because it doesn not exist).
@@ -560,15 +564,11 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl,
    * Note the priority is not effected by nice-ness.
    */
 
-#ifdef CONFIG_NSH_BUILTIN_APPS
-#if CONFIG_NFILE_STREAMS > 0
-  ret = nsh_builtin(vtbl, argv[0], argv, redirfile, oflags);
-#else
-  ret = nsh_builtin(vtbl, argv[0], argv, NULL, 0);
-#endif
+#ifdef CONFIG_NSH_FILE_APPS
+  ret = nsh_fileapp(vtbl, argv[0], argv, redirfile, oflags);
   if (ret >= 0)
     {
-      /* nsh_builtin() returned 0 or 1.  This means that the built-in
+      /* nsh_fileapp() returned 0 or 1.  This means that the built-in
        * command was successfully started (although it may not have ran
        * successfully).  So certainly it is not an NSH command.
        */
@@ -578,8 +578,8 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl,
       return nsh_saveresult(vtbl, ret != OK);
     }
 
-  /* No, not a built in command (or, at least, we were unable to start a
-   * built-in command of that name).  Treat it like an NSH command.
+  /* No, not a file name command (or, at least, we were unable to start a
+   * program of that name). Treat it like an NSH command.
    */
 
 #endif


[incubator-nuttx-apps] 02/02: nsh/parse: Try FILE_APPS first in the case of builtin

Posted by gn...@apache.org.
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 <an...@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 <an...@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 */