diff options
Diffstat (limited to 'storeio')
-rw-r--r-- | storeio/dev.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/storeio/dev.c b/storeio/dev.c index 78e0a177..8bdfa111 100644 --- a/storeio/dev.c +++ b/storeio/dev.c @@ -161,8 +161,11 @@ dev_open (struct dev *dev) to support this. */ store_set_flags (dev->store, STORE_INACTIVE); - dev->buf = mmap (0, dev->store->block_size, PROT_READ|PROT_WRITE, - MAP_ANON, 0, 0); + if (! dev->store->block_size) + dev->buf = NULL; + else + dev->buf = mmap (0, dev->store->block_size, PROT_READ|PROT_WRITE, + MAP_ANON, 0, 0); if (dev->buf == MAP_FAILED) { store_free (dev->store); |