瀏覽代碼

OSX: Use F_NOCACHE instead of F_GLOBAL_NOCACHE

The latter persists for the lifetime of the file, while the former
affects only the current descriptor.
Nils Maier 11 年之前
父節點
當前提交
f8db60e54e
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/AbstractDiskWriter.cc

+ 2 - 2
src/AbstractDiskWriter.cc

@@ -220,9 +220,9 @@ int openFileWithFlags(const std::string& filename, int flags,
                                    util::safeStrerror(errNum).c_str()),
                        errCode);
   }
-  // This may reduce memory consumption on Mac OS X. Not tested.
 #if defined(__APPLE__) && defined(__MACH__)
-  fcntl(fd, F_GLOBAL_NOCACHE, 1);
+  // This may reduce memory consumption on Mac OS X.
+  fcntl(fd, F_NOCACHE, 1);
 #endif // __APPLE__ && __MACH__
   return fd;
 }