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

Rémi Denis-Courmont remi at remlab.net
Wed Mar 6 13:35:18 CET 2013


On Wed,  6 Mar 2013 12:20:11 +0900, KO Myung-Hun <komh78 at gmail.com> wrote:
> 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;

I don't mind but to truly emulate a pipe with a socket pair, one direction
need to be shutdown(). In any case, fstat() will return a different file
type, but I guess we can ignore this subtlety. I do not know if this will
have undesirable side effects though.

>      fcntl (fds[0], F_SETFD, FD_CLOEXEC);

-- 
Rémi Denis-Courmont
Sent from my collocated server



More information about the vlc-devel mailing list