[vlc-devel] commit: decomp: fallback to write() if Linux vmsplice returns ENOSYS ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Jan 13 21:59:10 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Jan 13 22:36:21 2009 +0200| [5c63462c26ba6c1f435871168fa07e0b18b1e47b] | committer: Rémi Denis-Courmont 

decomp: fallback to write() if Linux vmsplice returns ENOSYS

(Since we are always dealing with a pipe, it cannot return EINVAL)

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

 modules/stream_filter/decomp.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/decomp.c b/modules/stream_filter/decomp.c
index f89d16d..7ec7b51 100644
--- a/modules/stream_filter/decomp.c
+++ b/modules/stream_filter/decomp.c
@@ -120,9 +120,9 @@ static void *Thread (void *data)
                 struct iovec iov = { buf + i, (len - i) & ~page_mask, };
                 j = vmsplice (fd, &iov, 1, SPLICE_F_GIFT);
             }
-#else
-            j = write (fd, buf + i, len - i);
+            if (j == -1 && errno == ENOSYS) /* vmsplice() not supported */
 #endif
+            j = write (fd, buf + i, len - i);
             if (j <= 0)
             {
                 if (j == 0)




More information about the vlc-devel mailing list