Browse Source

finally fixed the size properly

master
lars 14 years ago
parent
commit
9f23dbddfd
  1. 4
      src/cryptobox/core/blockdevice.py

4
src/cryptobox/core/blockdevice.py

@ -389,8 +389,8 @@ class Blockdevice:
default = 0
try:
size_blocks = int(file(os.path.join(self.devdir, 'size')).read())
## size is defined as the number of blocks (512 byte)
return int(size_blocks/512)
## size is defined as the number of blocks (512 byte each)
return int(size_blocks*512/1024/1024)
except OSError:
return default
except ValueError:

Loading…
Cancel
Save