diff options
Diffstat (limited to 'src/kernel/user/process.c')
-rw-r--r-- | src/kernel/user/process.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kernel/user/process.c b/src/kernel/user/process.c index 85530ca..18b4255 100644 --- a/src/kernel/user/process.c +++ b/src/kernel/user/process.c @@ -529,7 +529,7 @@ bool mmap_file(process_t *proc, fs_handle_t *h, size_t offset, void* addr, size_ if ((uint32_t)addr & (~PAGE_MASK)) return false; if ((uint32_t)offset & (~PAGE_MASK)) return false; - int fmode = file_get_mode(h); + int fmode = h->mode; if (!(fmode & FM_MMAP) || !(fmode & FM_READ)) return false; if ((mode & MM_WRITE) && !(fmode & FM_WRITE)) return false; @@ -573,7 +573,7 @@ bool mchmap(process_t *proc, void* addr, int mode) { if (r == 0) return false; if (r->file != 0) { - if ((mode & MM_WRITE) && !(file_get_mode(r->file) & FM_WRITE)) return false; + if ((mode & MM_WRITE) && !(r->file->mode & FM_WRITE)) return false; } r->mode = mode; |