You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/21 08:24:14 UTC

[GitHub] [incubator-nuttx-apps] pussuw opened a new pull request, #1147: nshlib/nsh_fileapps.c: Pass global environ instead of NULL for posix_spawnp

pussuw opened a new pull request, #1147:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1147

   
   Now that the environ pointer is a list of pointers-to-string, it can be
   passed to the standard posix_spawn function as-is.
   
   ## Summary
   
   ## Impact
   
   ## Testing
   icicle:nsh & icicle:knsh
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] xiaoxiang781216 merged pull request #1147: nshlib/nsh_fileapps.c: Pass global environ instead of NULL for posix_spawnp

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #1147:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1147


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] pussuw commented on a diff in pull request #1147: nshlib/nsh_fileapps.c: Pass global environ instead of NULL for posix_spawnp

Posted by GitBox <gi...@apache.org>.
pussuw commented on code in PR #1147:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1147#discussion_r855012170


##########
nshlib/nsh_fileapps.c:
##########
@@ -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);

Review Comment:
   The header file is already updated in:
   https://github.com/apache/incubator-nuttx/pull/6010
   
   Need to get it in first and this error will disappear



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx-apps] pkarashchenko commented on a diff in pull request #1147: nshlib/nsh_fileapps.c: Pass global environ instead of NULL for posix_spawnp

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #1147:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1147#discussion_r855010304


##########
nshlib/nsh_fileapps.c:
##########
@@ -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);

Review Comment:
   ```
   ====================================================================================
   Configuration/Tool: lc823450-xgevk/krndis,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI
   ------------------------------------------------------------------------------------
     Cleaning...
     Configuring...
     Disabling CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI
     Enabling CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI
     Building NuttX...
   arm-none-eabi-ld: /github/workspace/sources/nuttx/staging//libapps.a(nsh_fileapps.c.github.workspace.sources.apps.nshlib.o): in function `nsh_fileapp':
   /github/workspace/sources/apps/nshlib/nsh_fileapps.c:252: undefined reference to `get_environ_ptr'
   make[1]: *** [Makefile:59: nuttx_user.elf] Error 1
   make[1]: Target 'all' not remade because of errors.
   make: *** [tools/Unix.mk:498: nuttx] Error 2
   make: Target 'all' not remade because of errors.
   ```
   Should this be
   ```suggestion
   #ifndef CONFIG_DISABLE_ENVIRON
     ret = posix_spawnp(&pid, cmd, &file_actions, &attr, argv, environ);
   #else
     ret = posix_spawnp(&pid, cmd, &file_actions, &attr, argv, NULL);
   #endif
   ```
   Or maybe we can
   ```
   #ifndef CONFIG_DISABLE_ENVIRON
   #  define environ get_environ_ptr()
   #else
   #  define environ NULL
   #endif
   ```
   in `stdlib.h`.
   @xiaoxiang781216 what do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org