VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Platform
diff options
context:
space:
mode:
Diffstat (limited to 'src/Platform')
-rw-r--r--src/Platform/Exception.h3
-rw-r--r--src/Platform/SharedPtr.h2
-rw-r--r--src/Platform/Unix/File.cpp11
-rw-r--r--src/Platform/Unix/Process.cpp1
4 files changed, 13 insertions, 4 deletions
diff --git a/src/Platform/Exception.h b/src/Platform/Exception.h
index b0f04bba..36981a74 100644
--- a/src/Platform/Exception.h
+++ b/src/Platform/Exception.h
@@ -92,11 +92,10 @@ namespace VeraCrypt
TC_EXCEPTION (ParameterTooLarge); \
TC_EXCEPTION (PartitionDeviceRequired); \
TC_EXCEPTION (StringConversionFailed); \
+ TC_EXCEPTION (TerminalNotFound); \
TC_EXCEPTION (TestFailed); \
TC_EXCEPTION (TimeOut); \
TC_EXCEPTION (UnknownException); \
- TC_EXCEPTION (UnsupportedAlgoInTrueCryptMode); \
- TC_EXCEPTION (UnsupportedTrueCryptFormat); \
TC_EXCEPTION (UserAbort)
TC_EXCEPTION_SET;
diff --git a/src/Platform/SharedPtr.h b/src/Platform/SharedPtr.h
index 29669714..f80b2167 100644
--- a/src/Platform/SharedPtr.h
+++ b/src/Platform/SharedPtr.h
@@ -21,7 +21,7 @@
namespace VeraCrypt
{
-#if (__cplusplus >= 201103L)
+#if (__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__)
#define VC_USE_NATIVE_PTR 1
#endif
diff --git a/src/Platform/Unix/File.cpp b/src/Platform/Unix/File.cpp
index d3413800..207efb4e 100644
--- a/src/Platform/Unix/File.cpp
+++ b/src/Platform/Unix/File.cpp
@@ -222,6 +222,17 @@ namespace VeraCrypt
# endif
}
#endif
+#ifdef TC_LINUX
+ // On Linux, try to use BLKGETSIZE64 for devices
+ if (Path.IsDevice())
+ {
+ uint64 mediaSize;
+ if (ioctl (FileHandle, BLKGETSIZE64, &mediaSize) != -1)
+ {
+ return mediaSize;
+ }
+ }
+#endif
off_t current = lseek (FileHandle, 0, SEEK_CUR);
throw_sys_sub_if (current == -1, wstring (Path));
SeekEnd (0);
diff --git a/src/Platform/Unix/Process.cpp b/src/Platform/Unix/Process.cpp
index d148a686..36b01e6b 100644
--- a/src/Platform/Unix/Process.cpp
+++ b/src/Platform/Unix/Process.cpp
@@ -119,7 +119,6 @@ namespace VeraCrypt
throw_sys_if (fcntl (exceptionPipe.GetReadFD(), F_SETFL, O_NONBLOCK) == -1);
vector <char> buffer (4096), stdOutput (4096), errOutput (4096), exOutput (4096);
- buffer.clear ();
stdOutput.clear ();
errOutput.clear ();
exOutput.clear ();