[vlc-devel] commit: mmap: backport fcntl defined fix from [ 47a7e913b9c0dc31ba931bfac154d109cdb7e924] (Derk-Jan Hartman )

git version control git at videolan.org
Fri Oct 10 14:04:06 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Fri Oct 10 14:01:29 2008 +0200| [4a202532cc8cc0dd86ab76c9e8db5af0d29a9302] | committer: Derk-Jan Hartman 

mmap: backport fcntl defined fix from [47a7e913b9c0dc31ba931bfac154d109cdb7e924]

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

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

diff --git a/modules/access/mmap.c b/modules/access/mmap.c
index 0310e42..b9eadca 100644
--- a/modules/access/mmap.c
+++ b/modules/access/mmap.c
@@ -122,12 +122,16 @@ static int Open (vlc_object_t *p_this)
         goto error;
     }
 
-# if defined(HAVE_FCNTL_H) && defined(F_FDAHEAD) && defined(F_NOCACHE)
+#if defined(HAVE_FCNTL_H)
     /* We'd rather use any available memory for reading ahead
      * than for caching what we've already mmap'ed */
+# if defined(F_RDAHEAD)
     fcntl (fd, F_RDAHEAD, 1);
+# endif
+# if defined(F_NOCACHE)
     fcntl (fd, F_NOCACHE, 1);
 # endif
+#endif
 
     /* Autodetect mmap() support */
     if (st.st_size > 0)




More information about the vlc-devel mailing list