VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2017-11-29 17:26:23 +0100
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-11-29 17:27:39 +0100
commit668d5e3cad96a0dc79377d8c2dfba4ae600e483c (patch)
treef247517c0ef7d831cee8b56d12e9c465bd46034c /src
parentee6da31fb60bbdcb86945f23c3aebc6cdb7e30d3 (diff)
downloadVeraCrypt-668d5e3cad96a0dc79377d8c2dfba4ae600e483c.tar.gz
VeraCrypt-668d5e3cad96a0dc79377d8c2dfba4ae600e483c.zip
Linux: Only add disk to mountable devices if it doesn't have a partition. This fixes a strange issue where the function "open" would fail with error ENOENT (No such file or directory) on a partition (e.g. /dev/sdb1) if it was called previously on the main disk (e.g. /dev/sdb).
Diffstat (limited to 'src')
-rw-r--r--src/Main/UserInterface.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp
index b9fc5f9f..dfeb32fd 100644
--- a/src/Main/UserInterface.cpp
+++ b/src/Main/UserInterface.cpp
@@ -596,10 +596,13 @@ namespace VeraCrypt
HostDeviceList devices;
foreach (shared_ptr <HostDevice> device, Core->GetHostDevices (true))
{
- devices.push_back (device);
-
- foreach (shared_ptr <HostDevice> partition, device->Partitions)
- devices.push_back (partition);
+ if (device->Partitions.empty())
+ devices.push_back (device);
+ else
+ {
+ foreach (shared_ptr <HostDevice> partition, device->Partitions)
+ devices.push_back (partition);
+ }
}
set <wstring> mountedVolumes;