From c7c3c265e4ace960028a35889f23ebc485d5cc13 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 6 Oct 2002 15:45:07 +0000 Subject: [PATCH] When bopen() is called with buffer size 0, it switches to bopen_mm(). The plan is to make use of mmapping configurable by the buffer sizes in cf/sherlock. --- lib/fb-file.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/fb-file.c b/lib/fb-file.c index 5e1a6981..cfc586bb 100644 --- a/lib/fb-file.c +++ b/lib/fb-file.c @@ -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); -- 2.39.5