[vlc-devel] [PATCH 09/11] os2: filesystem: implement vlc_dup2()

KO Myung-Hun komh78 at gmail.com
Wed Jan 20 09:49:31 UTC 2021


---
 src/os2/filesystem.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/os2/filesystem.c b/src/os2/filesystem.c
index 124b80a1fb..95a1299bca 100644
--- a/src/os2/filesystem.c
+++ b/src/os2/filesystem.c
@@ -263,6 +263,15 @@ int vlc_dup (int oldfd)
     return newfd;
 }
 
+int vlc_dup2 (int oldfd, int newfd)
+{
+    int fd = dup2 (oldfd, newfd);
+    if (fd != -1)
+        setmode (fd, O_BINARY);
+
+    return fd;
+}
+
 int vlc_pipe (int fds[2])
 {
     if (vlc_socketpair (AF_LOCAL, SOCK_STREAM, 0, fds, false))
-- 
2.22.0



More information about the vlc-devel mailing list