Follow up task_spawn change from kernel side
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
e9104dbbef
commit
58293abb8e
@ -192,9 +192,10 @@ 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,
|
||||
pid = task_spawn(builtin->name, builtin->main, &file_actions,
|
||||
&attr, (argv) ? &argv[1] : (FAR char * const *)NULL,
|
||||
(FAR char * const *)NULL);
|
||||
ret = pid < 0 ? -pid : 0;
|
||||
}
|
||||
|
||||
if (ret != 0)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* apps/popen/popen/popen.c
|
||||
* apps/system/popen/popen.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@ -253,13 +253,17 @@ FILE *popen(FAR const char *command, FAR const char *mode)
|
||||
&file_actions, &attr, argv,
|
||||
(FAR char * const *)NULL);
|
||||
#else
|
||||
errcode = task_spawn(&container->shell, "popen", nsh_system, &file_actions,
|
||||
&attr, argv, (FAR char * const *)NULL);
|
||||
container->shell = task_spawn("popen", nsh_system, &file_actions,
|
||||
&attr, argv, (FAR char * const *)NULL);
|
||||
if (container->shell < 0)
|
||||
{
|
||||
errcode = -container->shell;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (errcode != 0)
|
||||
{
|
||||
serr("ERROR: Spawn failed: %d\n", result);
|
||||
serr("ERROR: Spawn failed: %d\n", errcode);
|
||||
goto errout_with_actions;
|
||||
}
|
||||
|
||||
|
@ -136,8 +136,12 @@ int system(FAR const char *cmd)
|
||||
errcode = posix_spawn(&pid, CONFIG_SYSTEM_SYSTEM_SHPATH, NULL, &attr,
|
||||
argv, (FAR char * const *)NULL);
|
||||
#else
|
||||
errcode = task_spawn(&pid, "system", nsh_system, NULL, &attr,
|
||||
argv, (FAR char * const *)NULL);
|
||||
pid = task_spawn("system", nsh_system, NULL, &attr,
|
||||
argv, (FAR char * const *)NULL);
|
||||
if (pid < 0)
|
||||
{
|
||||
errcode = -pid;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Release the attributes and check for an error from the spawn operation */
|
||||
|
Loading…
Reference in New Issue
Block a user