[vlc-devel] [PATCH 2/2] cli: use vlc_dup2()

remi at remlab.net remi at remlab.net
Sun Nov 29 14:56:42 CET 2020


From: RĂ©mi Denis-Courmont <remi at remlab.net>

---
 modules/control/cli/cli.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/modules/control/cli/cli.c b/modules/control/cli/cli.c
index 9c93a26f9a..2fa1e7b90d 100644
--- a/modules/control/cli/cli.c
+++ b/modules/control/cli/cli.c
@@ -224,11 +224,7 @@ static int LogOut(struct cli_client *cl, const char *const *args, size_t count,
 
         fflush(cl->stream);
         if (fd2 != 1)
-#ifdef HAVE_DUP3
-            dup3(fd, fd2, O_CLOEXEC);
-#else
-            dup2(fd, fd2), fcntl(fd2, F_SETFD, FD_CLOEXEC);
-#endif
+            vlc_dup2(fd, fd2);
         else
             dup2(fd, fd2);
         fseek(cl->stream, 0, SEEK_SET);
-- 
2.29.2



More information about the vlc-devel mailing list