[vlc-commits] file out: print I/O error to log and fix error handling

Rémi Denis-Courmont git at videolan.org
Thu Nov 29 16:45:44 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Nov 29 17:37:37 2012 +0200| [18710af18b03c877d29bc06d3b73c1ccf2ac159f] | committer: Rémi Denis-Courmont

file out: print I/O error to log and fix error handling

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

 modules/access_output/file.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/access_output/file.c b/modules/access_output/file.c
index 5b2ec29..07ecaaf 100644
--- a/modules/access_output/file.c
+++ b/modules/access_output/file.c
@@ -274,11 +274,12 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
     {
         ssize_t val = write ((intptr_t)p_access->p_sys,
                              p_buffer->p_buffer, p_buffer->i_buffer);
-        if (val == -1)
+        if (val <= 0)
         {
             if (errno == EINTR)
                 continue;
             block_ChainRelease (p_buffer);
+            msg_Err( p_access, "cannot write: %m" );
             return -1;
         }
 



More information about the vlc-commits mailing list