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:
dongjiuzhu1 2023-10-16 17:05:32 +08:00 committed by Xiang Xiao
parent 4068f11129
commit 5c98649a7a

View File

@ -66,7 +66,6 @@ int posix_spawn_file_actions_adddup2(
int fd1, int fd2) int fd1, int fd2)
{ {
FAR struct spawn_dup2_file_action_s *entry; FAR struct spawn_dup2_file_action_s *entry;
int flags;
DEBUGASSERT(file_actions && fd1 >= 0 && fd2 >= 0); DEBUGASSERT(file_actions && fd1 >= 0 && fd2 >= 0);
@ -86,23 +85,6 @@ int posix_spawn_file_actions_adddup2(
entry->fd1 = fd1; entry->fd1 = fd1;
entry->fd2 = fd2; 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 */ /* And add it to the file action list */
add_file_action(file_actions, add_file_action(file_actions,