diff options
| author | San Mehat <san@google.com> | 2010-01-11 09:17:25 -0800 |
|---|---|---|
| committer | San Mehat <san@google.com> | 2010-01-11 09:17:25 -0800 |
| commit | 8b8f71b1d760411279f3b07a5c97709f052c689e (patch) | |
| tree | 42b1009d8619b23173b15aa0c9386e184d40f9ed /Loop.cpp | |
| parent | b78a32c1d5eeb243bdac0eaf18effb1897f1ee67 (diff) | |
| download | android_system_vold-8b8f71b1d760411279f3b07a5c97709f052c689e.tar.gz android_system_vold-8b8f71b1d760411279f3b07a5c97709f052c689e.tar.bz2 android_system_vold-8b8f71b1d760411279f3b07a5c97709f052c689e.zip | |
vold: Internally use sector counts for asec lengths
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'Loop.cpp')
| -rw-r--r-- | Loop.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -181,17 +181,17 @@ int Loop::destroyByFile(const char *loopFile) { return -1; } -int Loop::createImageFile(const char *file, size_t sizeMb) { +int Loop::createImageFile(const char *file, unsigned int numSectors) { int fd; - LOGD("Creating ASEC image file %s (%d mb)", file, sizeMb); + LOGD("Creating ASEC image file %s (%u sectors)", file, numSectors); if ((fd = creat(file, 0600)) < 0) { LOGE("Error creating imagefile (%s)", strerror(errno)); return -1; } - if (ftruncate(fd, 1024 + (sizeMb * (1024 * 1024))) < 0) { + if (ftruncate(fd, numSectors * 512) < 0) { LOGE("Error truncating imagefile (%s)", strerror(errno)); close(fd); return -1; |
