mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
system/popen: remove O_CLOEXEC if mode exinclude 'e'
refs: https://man7.org/linux/man-pages/man3/popen.3.html Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
cc66e34fbf
commit
e61ff51e67
1 changed files with 5 additions and 0 deletions
|
|
@ -320,6 +320,11 @@ FILE *popen(FAR const char *command, FAR const char *mode)
|
|||
posix_spawn_file_actions_destroy(&file_actions);
|
||||
posix_spawnattr_destroy(&attr);
|
||||
|
||||
if (strchr(mode, 'e') == NULL)
|
||||
{
|
||||
fcntl(retfd, F_SETFD, 0);
|
||||
}
|
||||
|
||||
/* Finale and return input input/output stream */
|
||||
|
||||
memcpy(&container->copy, container->original, sizeof(FILE));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue