From 0957a740cb589ab3009bdfa0379b8af9e760e7f6 Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Thu, 21 Apr 2022 11:22:44 +0300 Subject: [PATCH] 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 +#include #include #include #include @@ -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.