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.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2022-07-29 08:10:48 +09:00 committed by Xiang Xiao
parent 1345fa13b1
commit 147a796a7a
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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.