mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 02:48:37 +08:00
libs/lib_psfa_adddup2.c: remove workaround aboud dup2
Because popen no longer needs to rely on intermediate tasks to start command tasks. Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
4068f11129
commit
5c98649a7a
1 changed files with 0 additions and 18 deletions
|
@ -66,7 +66,6 @@ int posix_spawn_file_actions_adddup2(
|
|||
int fd1, int fd2)
|
||||
{
|
||||
FAR struct spawn_dup2_file_action_s *entry;
|
||||
int flags;
|
||||
|
||||
DEBUGASSERT(file_actions && fd1 >= 0 && fd2 >= 0);
|
||||
|
||||
|
@ -86,23 +85,6 @@ int posix_spawn_file_actions_adddup2(
|
|||
entry->fd1 = fd1;
|
||||
entry->fd2 = fd2;
|
||||
|
||||
/* NOTE: Workaround to avoid an error when executing dup2 action */
|
||||
|
||||
flags = fcntl(fd1, F_GETFD);
|
||||
if (flags < 0)
|
||||
{
|
||||
lib_free(entry);
|
||||
return flags;
|
||||
}
|
||||
|
||||
flags &= ~FD_CLOEXEC;
|
||||
flags = fcntl(fd1, F_SETFD, flags);
|
||||
if (flags < 0)
|
||||
{
|
||||
lib_free(entry);
|
||||
return flags;
|
||||
}
|
||||
|
||||
/* And add it to the file action list */
|
||||
|
||||
add_file_action(file_actions,
|
||||
|
|
Loading…
Reference in a new issue