# HG changeset patch # User ramiro # Date 1186702919 0 # Node ID 3dfa90f47d539c257aeb5c535d0410a393a27ebd # Parent b9a881c0967e9c04e91ea42241659e7cf750768e Make the pipe URLProtocol share read and write functions with the file URLProtocol diff -r b9a881c0967e -r 3dfa90f47d53 file.c --- a/file.c Thu Aug 09 23:39:05 2007 +0000 +++ b/file.c Thu Aug 09 23:41:59 2007 +0000 @@ -110,22 +110,11 @@ return read(fd, buf, size); } -static int pipe_write(URLContext *h, unsigned char *buf, int size) -{ - int fd = (size_t)h->priv_data; - return write(fd, buf, size); -} - -static int pipe_close(URLContext *h) -{ - return 0; -} - URLProtocol pipe_protocol = { "pipe", pipe_open, - pipe_read, - pipe_write, + file_read, + file_write, NULL, pipe_close, };