]> git.sesse.net Git - vlc/commitdiff
mmap: backport fcntl defined fix from [47a7e913b9c0dc31ba931bfac154d109cdb7e924]
authorDerk-Jan Hartman <hartman@videolan.org>
Fri, 10 Oct 2008 12:01:29 +0000 (14:01 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Fri, 10 Oct 2008 12:01:29 +0000 (14:01 +0200)
modules/access/mmap.c

index 0310e42d6c06a7db0fa6a11d6bcc8735f884ac01..b9eadcaa06354bc332875537fa0b57d98c945502 100644 (file)
@@ -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)