From 9f23dbddfd07297c8ecb2429327d2110a45b818f Mon Sep 17 00:00:00 2001 From: lars Date: Mon, 14 Jan 2008 22:11:03 +0000 Subject: [PATCH] finally fixed the size properly --- src/cryptobox/core/blockdevice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cryptobox/core/blockdevice.py b/src/cryptobox/core/blockdevice.py index 8536520..5473cd8 100644 --- a/src/cryptobox/core/blockdevice.py +++ b/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: