]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fb-file.c
Added very simple functions for emulating a fastbuf stream over a static
[libucw.git] / lib / fb-file.c
index 5e1a6981eea4a66ad31644d61bc28911ef059e2c..cfc586bb3a69918ed27c1004b1fa717593709e17 100644 (file)
@@ -120,18 +120,11 @@ struct fastbuf *
 bopen(byte *name, uns mode, uns buffer)
 {
   struct fastbuf *b;
+  int fd;
 
-#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 (!buffer)
+    return bopen_mm(name, mode);
+  fd = sh_open(name, mode, 0666);
   if (fd < 0)
     die("Unable to %s file %s: %m",
        (mode & O_CREAT) ? "create" : "open", name);