[vlc-devel] commit: mmap: handle I/O errors as fatal ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Sep 20 00:50:26 CEST 2008


vlc | branch: 0.9-bugfix | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Sep 16 18:52:15 2008 +0300| [f3515ac6b09480908c20710d18a815bddeb81401] | committer: Jean-Baptiste Kempf 

mmap: handle I/O errors as fatal
(cherry picked from commit 270d4c8d81428c511306d4ca9c0973319ec34aa0)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/access/mmap.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/modules/access/mmap.c b/modules/access/mmap.c
index 703fdea..b175671 100644
--- a/modules/access/mmap.c
+++ b/modules/access/mmap.c
@@ -220,8 +220,7 @@ static block_t *Block (access_t *p_access)
         msg_Err (p_access, "memory mapping failed (%m)");
         intf_UserFatal (p_access, false, _("File reading failed"),
                         _("VLC could not read the file."));
-        msleep (INPUT_ERROR_SLEEP);
-        return NULL;
+        goto fatal;
     }
 #ifdef HAVE_POSIX_MADVISE    
     posix_madvise (addr, length, POSIX_MADV_SEQUENTIAL);
@@ -229,7 +228,7 @@ static block_t *Block (access_t *p_access)
 
     block_t *block = block_mmap_Alloc (addr, length);
     if (block == NULL)
-        return NULL;
+        goto fatal;
 
     block->p_buffer += inner_offset;
     block->i_buffer -= inner_offset;
@@ -252,6 +251,10 @@ static block_t *Block (access_t *p_access)
 
     p_access->info.i_pos = outer_offset + length;
     return block;
+
+fatal:
+    p_access->info.b_eof = true;
+    return NULL;
 }
 
 




More information about the vlc-devel mailing list