[vlc-devel] [PATCH] os2: use socketpair() as a backend for vlc_pipe()

KO Myung-Hun komh78 at gmail.com
Wed Mar 6 04:20:11 CET 2013


---
 src/misc/objects.c   |   10 +++-------
 src/os2/filesystem.c |    2 +-
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/misc/objects.c b/src/misc/objects.c
index 3e365bd..07dc759 100644
--- a/src/misc/objects.c
+++ b/src/misc/objects.c
@@ -52,11 +52,7 @@
 # include <search.h>
 #endif
 
-#ifdef __OS2__
-# include <sys/socket.h>
-# include <netinet/in.h>
-# include <unistd.h>    // close(), write()
-#elif defined(WIN32)
+#ifdef WIN32
 # include <io.h>
 # include <winsock2.h>
 # include <ws2tcpip.h>
@@ -287,7 +283,7 @@ static void vlc_object_destroy( vlc_object_t *p_this )
 }
 
 
-#if defined(WIN32) || defined(__OS2__)
+#ifdef WIN32
 /**
  * select()-able pipes emulated using Winsock
  */
@@ -329,7 +325,7 @@ error:
         close (c);
     return -1;
 }
-#endif /* WIN32 || __OS2__ */
+#endif /* WIN32 */
 
 static vlc_mutex_t pipe_lock = VLC_STATIC_MUTEX;
 
diff --git a/src/os2/filesystem.c b/src/os2/filesystem.c
index b9d03eb..b4ba8db 100644
--- a/src/os2/filesystem.c
+++ b/src/os2/filesystem.c
@@ -334,7 +334,7 @@ int vlc_dup (int oldfd)
  */
 int vlc_pipe (int fds[2])
 {
-    if (pipe (fds))
+    if (socketpair (AF_LOCAL, SOCK_STREAM, 0, fds))
         return -1;
 
     fcntl (fds[0], F_SETFD, FD_CLOEXEC);
-- 
1.7.3.2




More information about the vlc-devel mailing list