summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2016-01-12 05:21:18 +0100
committerDees Troy <dees_troy@teamw.in>2016-01-14 17:40:43 +0100
commit483e9f45b71458b84ccbbaf658449b58f029a63b (patch)
treeb3542c7aba58b360faed66f65f375ec8a6b1e1bb /partition.cpp
parentgui: theme changes for terminal (diff)
downloadandroid_bootable_recovery-483e9f45b71458b84ccbbaf658449b58f029a63b.tar
android_bootable_recovery-483e9f45b71458b84ccbbaf658449b58f029a63b.tar.gz
android_bootable_recovery-483e9f45b71458b84ccbbaf658449b58f029a63b.tar.bz2
android_bootable_recovery-483e9f45b71458b84ccbbaf658449b58f029a63b.tar.lz
android_bootable_recovery-483e9f45b71458b84ccbbaf658449b58f029a63b.tar.xz
android_bootable_recovery-483e9f45b71458b84ccbbaf658449b58f029a63b.tar.zst
android_bootable_recovery-483e9f45b71458b84ccbbaf658449b58f029a63b.zip
Diffstat (limited to 'partition.cpp')
-rw-r--r--partition.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/partition.cpp b/partition.cpp
index 2f37d6f89..a8de4a903 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -880,23 +880,9 @@ bool TWPartition::Get_Size_Via_df(bool Display_Error) {
}
unsigned long long TWPartition::IOCTL_Get_Block_Size() {
- unsigned long block_device_size;
- int ret = 0;
-
Find_Actual_Block_Device();
- int fd = open(Actual_Block_Device.c_str(), O_RDONLY);
- if (fd < 0) {
- LOGINFO("Find_Partition_Size: Failed to open '%s', (%s)\n", Actual_Block_Device.c_str(), strerror(errno));
- } else {
- ret = ioctl(fd, BLKGETSIZE, &block_device_size);
- close(fd);
- if (ret) {
- LOGINFO("Find_Partition_Size: ioctl error: (%s)\n", strerror(errno));
- } else {
- return (unsigned long long)(block_device_size) * 512LLU;
- }
- }
- return 0;
+
+ return TWFunc::IOCTL_Get_Block_Size(Actual_Block_Device.c_str());
}
bool TWPartition::Find_Partition_Size(void) {