From 434c630cf7aa4b4facc1d2fcfb6e9bc4cf21dff1 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Tue, 29 May 2007 14:50:48 +0200 Subject: [PATCH] tried parametrized fastbuf for most of indexing I/O ... but there are still bugs, only std I/O passed --- lib/fb-mmap.c | 2 -- lib/fb-param.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fb-mmap.c b/lib/fb-mmap.c index 13087d6e..cb1fd06b 100644 --- a/lib/fb-mmap.c +++ b/lib/fb-mmap.c @@ -192,8 +192,6 @@ bfmmopen_internal(int fd, byte *name, uns mode) struct fastbuf * bopen_mm(byte *name, uns mode) { - if ((mode & O_ACCMODE) == O_WRONLY) - mode = (mode & ~O_ACCMODE) | O_RDWR; return bopen_file(name, mode, &(struct fb_params){ .type = FB_MMAP }); } diff --git a/lib/fb-param.c b/lib/fb-param.c index e97e2293..38cd5801 100644 --- a/lib/fb-param.c +++ b/lib/fb-param.c @@ -80,6 +80,8 @@ bopen_file_internal(byte *name, int mode, struct fb_params *params, int try) { if (params->type == FB_DIRECT && !fbdir_cheat) mode |= O_DIRECT; + if (params->type == FB_MMAP && (mode & O_ACCMODE) == O_WRONLY) + mode = (mode & ~O_ACCMODE) | O_RDWR; int fd = sh_open(name, mode, 0666); if (fd < 0) if (try) -- 2.39.5