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

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


The following commit(s) were added to refs/heads/master by this push:
     new 147a796a7 system: popen: Fix to build with CONFIG_BUILD_KERNEL=y
147a796a7 is described below

commit 147a796a7ab72d45f066ddc8900de53f507fcd7c
Author: Masayuki Ishikawa <masayuki.ishik...@gmail.com>
AuthorDate: Fri Jul 29 08:10:48 2022 +0900

    system: popen: Fix to build with CONFIG_BUILD_KERNEL=y
    
    Summary:
    - This commit fixes to build with CONFIG_BUILD_KERNEL=y
    
    Impact:
    - None
    
    Testing:
    - Tested with sabre-6quad:knsh (not merged yet)
    
    Signed-off-by: Masayuki Ishikawa <masayuki.ishik...@jp.sony.com>
---
 system/popen/Kconfig | 2 +-
 system/popen/popen.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/system/popen/Kconfig b/system/popen/Kconfig
index 14a245fb0..1f1907fce 100644
--- a/system/popen/Kconfig
+++ b/system/popen/Kconfig
@@ -18,7 +18,7 @@ if SYSTEM_POPEN
 config SYSTEM_POPEN_SHPATH
        string "Path to shell command"
        default "/bin/sh"
-       depends on SYSTEM_NSH=m
+       depends on SYSTEM_NSH=m || BUILD_KERNEL
        ---help---
                This is the full path to the program in a mounted file system 
that
                implements the system() command.  That is, a program that 
starts the
diff --git a/system/popen/popen.c b/system/popen/popen.c
index eb950cca5..f02ca3b81 100644
--- a/system/popen/popen.c
+++ b/system/popen/popen.c
@@ -197,12 +197,14 @@ FILE *popen(FAR const char *command, FAR const char *mode)
       goto errout_with_actions;
     }
 
+#ifndef CONFIG_SYSTEM_POPEN_SHPATH
   errcode = task_spawnattr_setstacksize(&attr,
                                         CONFIG_SYSTEM_POPEN_STACKSIZE);
   if (errcode != 0)
     {
       goto errout_with_actions;
     }
+#endif
 
   /* If robin robin scheduling is enabled, then set the scheduling policy
    * of the new task to SCHED_RR before it has a chance to run.

Reply via email to