[vlc-commits] os2: filesystem: implement vlc_dup2()

KO Myung-Hun git at videolan.org
Fri Jan 29 14:54:37 UTC 2021


vlc | branch: master | KO Myung-Hun <komh78 at gmail.com> | Wed Jan 20 10:49:00 2021 +0100| [63dc94937e782ee43987389ce0316ddc1da4242c] | committer: Steve Lhomme

os2: filesystem: implement vlc_dup2()

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=63dc94937e782ee43987389ce0316ddc1da4242c
---

 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))



More information about the vlc-commits mailing list