Commit 4aca906b authored by KO Myung-Hun's avatar KO Myung-Hun Committed by Jean-Baptiste Kempf

os2: filesystem: re-implement vlc_pipe() with socketpair()

This improves the compatibility with vlc_poll().
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 70239ac0
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_charset.h> #include <vlc_charset.h>
#include <vlc_fs.h> #include <vlc_fs.h>
#include <vlc_network.h>
#include "libvlc.h" /* vlc_mkdir */ #include "libvlc.h" /* vlc_mkdir */
int vlc_open (const char *filename, int flags, ...) int vlc_open (const char *filename, int flags, ...)
...@@ -257,9 +258,12 @@ int vlc_dup (int oldfd) ...@@ -257,9 +258,12 @@ int vlc_dup (int oldfd)
int vlc_pipe (int fds[2]) int vlc_pipe (int fds[2])
{ {
if (pipe (fds)) if (socketpair (AF_LOCAL, SOCK_STREAM, 0, fds))
return -1; return -1;
shutdown (fds[0], SHUT_WR);
shutdown (fds[1], SHUT_RD);
setmode (fds[0], O_BINARY); setmode (fds[0], O_BINARY);
setmode (fds[1], O_BINARY); setmode (fds[1], O_BINARY);
...@@ -298,8 +302,6 @@ ssize_t vlc_writev(int fd, const struct iovec *iov, int count) ...@@ -298,8 +302,6 @@ ssize_t vlc_writev(int fd, const struct iovec *iov, int count)
return val; return val;
} }
#include <vlc_network.h>
int vlc_socket (int pf, int type, int proto, bool nonblock) int vlc_socket (int pf, int type, int proto, bool nonblock)
{ {
int fd; int fd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment