From 5c98649a7a640e5161330076151052d69c2982cb Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Mon, 16 Oct 2023 17:05:32 +0800 Subject: [PATCH] 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 --- libs/libc/spawn/lib_psfa_adddup2.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/libs/libc/spawn/lib_psfa_adddup2.c b/libs/libc/spawn/lib_psfa_adddup2.c index 67828f373b..58697a6120 100644 --- a/libs/libc/spawn/lib_psfa_adddup2.c +++ b/libs/libc/spawn/lib_psfa_adddup2.c @@ -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,