diff options
author | Miles Bader <miles@gnu.org> | 1996-05-22 00:00:43 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-05-22 00:00:43 +0000 |
commit | 7923631d706ab5d80b5274966343fb25bce3d375 (patch) | |
tree | 538a7e996e4b4bb272a2fe1d4a4dbc1a9b7e7521 | |
parent | 9811825d556184f5fd207361eb59012ad622ed03 (diff) |
(store_write): Return an error if STORE is readonly.
(store_read, store_read): References to METHS field changed to CLASS.
-rw-r--r-- | libstore/rdwr.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libstore/rdwr.c b/libstore/rdwr.c index 2757fb68..9e9d3f84 100644 --- a/libstore/rdwr.c +++ b/libstore/rdwr.c @@ -101,7 +101,10 @@ store_write (struct store *store, off_t base; struct store_run *run, *runs_end; int block_shift = store->log2_block_size; - store_write_meth_t write = store->meths->write; + store_write_meth_t write = store->class->write; + + if (store->flags & STORE_READONLY) + return EROFS; /* XXX */ addr = store_find_first_run (store, addr, &run, &runs_end, &base, &index); if (addr < 0) @@ -167,7 +170,7 @@ store_read (struct store *store, off_t base; struct store_run *run, *runs_end; int block_shift = store->log2_block_size; - store_read_meth_t read = store->meths->read; + store_read_meth_t read = store->class->read; addr = store_find_first_run (store, addr, &run, &runs_end, &base, &index); if (addr < 0) |