summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-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) {