VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Platform/Unix/FilesystemPath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Platform/Unix/FilesystemPath.cpp')
-rw-r--r--src/Platform/Unix/FilesystemPath.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Platform/Unix/FilesystemPath.cpp b/src/Platform/Unix/FilesystemPath.cpp
index d6c9cd2b..1230c2aa 100644
--- a/src/Platform/Unix/FilesystemPath.cpp
+++ b/src/Platform/Unix/FilesystemPath.cpp
@@ -15,6 +15,9 @@
#include "Platform/StringConverter.h"
#include <stdio.h>
#include <sys/stat.h>
+#if !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__OpenBSD__)
+#include <sys/sysmacros.h>
+#endif
namespace VeraCrypt
{
@@ -104,8 +107,11 @@ namespace VeraCrypt
string pathStr = StringConverter::ToSingle (Path);
size_t p = pathStr.rfind ("s");
- if (p == string::npos)
- throw PartitionDeviceRequired (SRC_POS);
+ if (p == string::npos) {
+ p = pathStr.rfind ("p");
+ if (p == string::npos)
+ throw PartitionDeviceRequired (SRC_POS);
+ }
path = pathStr.substr (0, p);
#elif defined (TC_SOLARIS)