From 668d5e3cad96a0dc79377d8c2dfba4ae600e483c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 29 Nov 2017 17:26:23 +0100 Subject: 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). --- src/Main/UserInterface.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/Main') 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 device, Core->GetHostDevices (true)) { - devices.push_back (device); - - foreach (shared_ptr partition, device->Partitions) - devices.push_back (partition); + if (device->Partitions.empty()) + devices.push_back (device); + else + { + foreach (shared_ptr partition, device->Partitions) + devices.push_back (partition); + } } set mountedVolumes; -- cgit v1.2.3