You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/04/21 12:58:10 UTC
[incubator-nuttx-apps] branch master updated: nshlib/nsh_fileapps.c: Pass global environ instead of NULL for posix_spawnp
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 0957a740c nshlib/nsh_fileapps.c: Pass global environ instead of NULL for posix_spawnp
0957a740c is described below
commit 0957a740cb589ab3009bdfa0379b8af9e760e7f6
Author: Ville Juven <vi...@unikie.com>
AuthorDate: Thu Apr 21 11:22:44 2022 +0300
nshlib/nsh_fileapps.c: Pass global environ instead of NULL for posix_spawnp
Now that the environ pointer is a list of pointers-to-string, it can be
passed to the standard posix_spawn function as-is.
---
nshlib/nsh_fileapps.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/nshlib/nsh_fileapps.c b/nshlib/nsh_fileapps.c
index 7e3f94e0d..98c50dffa 100644
--- a/nshlib/nsh_fileapps.c
+++ b/nshlib/nsh_fileapps.c
@@ -30,6 +30,7 @@
#endif
#include <stdbool.h>
+#include <stdlib.h>
#include <spawn.h>
#include <errno.h>
#include <string.h>
@@ -126,7 +127,7 @@ int nsh_fileapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
* failure.
*/
- ret = posix_spawnp(&pid, cmd, &file_actions, &attr, argv, NULL);
+ ret = posix_spawnp(&pid, cmd, &file_actions, &attr, argv, environ);
if (ret == OK)
{
/* The application was successfully started with pre-emption disabled.