]> mj.ucw.cz Git - libucw.git/commitdiff
Added a temporary hack for testing of fb-mmap. Please don't turn it on
authorMartin Mares <mj@ucw.cz>
Thu, 3 Oct 2002 21:02:58 +0000 (21:02 +0000)
committerMartin Mares <mj@ucw.cz>
Thu, 3 Oct 2002 21:02:58 +0000 (21:02 +0000)
unless you're willing to help me with debugging fb-mmap :-)

lib/fb-file.c

index 7d9de003abf6a7fb9f3cfc95b2253af71b308b67..5e1a6981eea4a66ad31644d61bc28911ef059e2c 100644 (file)
@@ -120,6 +120,17 @@ struct fastbuf *
 bopen(byte *name, uns mode, uns buffer)
 {
   struct fastbuf *b;
+
+#if 0 /* FIXME: Dirty hack for testing fb-mmap */
+  if (buffer >= 65536 && (mode == O_RDONLY))
+    {
+      log(L_DEBUG, "bopen_mm hack: %s", name);
+      if (mode & O_WRONLY)
+       mode = (mode & ~O_WRONLY) | O_RDWR;
+      return bopen_mm(name, mode);
+    }
+#endif
+
   int fd = sh_open(name, mode, 0666);
   if (fd < 0)
     die("Unable to %s file %s: %m",