diff options
author | Roland McGrath <roland@gnu.org> | 1999-10-07 20:53:03 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1999-10-07 20:53:03 +0000 |
commit | 438c23ab1c64ea66fdad2400ca852404c4622860 (patch) | |
tree | 3beef311a64e81077207168791d97e864fbf4379 /libstore | |
parent | e8870cdf23680e9b391ff35a68b7e06b4c661704 (diff) |
1999-10-07 Roland McGrath <roland@baalperazim.frob.com>
* rdwr.c (store_read, store_write): Fix asserts in last change.
Diffstat (limited to 'libstore')
-rw-r--r-- | libstore/rdwr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libstore/rdwr.c b/libstore/rdwr.c index 94b0fa24..85d2ba2b 100644 --- a/libstore/rdwr.c +++ b/libstore/rdwr.c @@ -107,7 +107,8 @@ store_write (struct store *store, if (store->flags & STORE_READONLY) return EROFS; /* XXX */ - assert ((len & (block_shift - 1)) == 0); + if (store->block_size != 0) + assert ((len & (store->block_size - 1)) == 0); addr = store_find_first_run (store, addr, &run, &runs_end, &base, &index); if (addr < 0) @@ -183,7 +184,8 @@ store_read (struct store *store, if (addr < 0 || run->start < 0) return EIO; /* Reading from a hole. */ - assert ((amount & (block_shift - 1)) == 0); + if (store->block_size != 0) + assert ((amount & (store->block_size - 1)) == 0); if ((amount >> block_shift) <= run->length - addr) /* The first run has it all... */ |